answersLogoWhite

0


Best Answer

#include<stdio.h>

#include<conio.h>

void main()

{

int i,fact=1,n;

clrscr();

printf("\nEnter the no of terms =");

scanf("%d",&n);

for(i=1;i<=n;i++)

fact*=i;

printf("\nFactorial value for %d terms = %d",n,fact);

getch();

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

#include<stdio.h>

#include<conio.h>

void main()

{

int fact(int);

int a,b,c,n,r;

clrscr();

printf("Enter values of n and r \n");

scanf("%d%d",&n,&r);

a=fact(n);

b=fact(r);

c=fact(n-r);

printf("Output=%2f \n",a\(b*c));

getch();

}

int fact(int n)

{

int(n==1)

return 1;

else

f=n*(fact*(n-1));

return f;

}

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

Quite a popular question, it is the 7th time I answer it;)

int fact (int n)

{

if (n<=1) return 1;

else return n*fact(n-1);

}

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Program in C language to find factorial value Fibonacci valueGCD value using recursion?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering
Related questions