Wednesday, April 27, 2022

C program to find factorial of given number using recursive function | C program important question class 12

Write a program to find factorial of given number using recursive function in c program .

Solution :

#include<stdio.h>

#include<conio.h>

int fact(int);

void main(){

int n,f;

printf("Enter no. for finding factorial");

scanf("%d",&n);

f=fact(n);

printf("factorial is %d",f);

getch();

}

int fact(int n){

if(n==0){

return(1);

}

else{

return(n*fact(n-1));

}

}


OUTPUT :


This question is also one of the most important questions of c program for class 11 and 12 computer science . Further more questions and solutions visit our blog
https://tukustech.blogspot.com/




No comments:

Post a Comment

BCA ENTRANCE RESULT 2079 - CHECK YOUR BCA RESULT

 Hello everyone BCA Entrance result of TU ( 2079 ) is published . You can check your result by downloading pdf , so go on this video and dow...