आपकी ऑफलाइन सहायता

BACK
49

सी प्रोग्रामिंग

149

पाइथन प्रोग्रामिंग

49

सी प्लस प्लस

99

जावा प्रोग्रामिंग

149

जावास्क्रिप्ट

49

एंगुलर जे.एस.

69

पी.एच.पी.
माय एस.क्यू.एल.

99

एस.क्यू.एल.

Free

एच.टी.एम.एल.

99

सी.एस.एस.

149

आर प्रोग्रामिंग

39

जे.एस.पी.





डाउनलोड पी.डी.एफ. ई-बुक्स
C - Factorial Of Number Using Recursion

विवरण :

कोई विवरण नहीं है |


सोर्स कोड :

#include <stdio.h>
#include <conio.h>
 
void main(){
    
int a,fact;

printf("Enter the number : ");
scanf("%d",&a);

fact=factorial(a);

printf("Factorial of %d is %d",a,fact);
getch ();
}
int factorial (int x)
{
int f;
if(x==1){
return (1);
}
else{
f=x*factorial(x-1);
}
return(f);
}

आउटपुट :

Enter the number : 5 (you entered : 5)
Factorial of 5 is 120