Write a menu driven program to (i) generate Fibonacci series between 1 to 200 using while loop. 0,1,1,2,3,5,8,13,21……… (b) Write a program to find factorial of a number
Share
Write a menu driven program to (i) generate Fibonacci series between 1 to 200 using while loop. 0,1,1,2,3,5,8,13,21……… (b) Write a program to find factorial of a number
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Answer:
factorial of a no:
// create a function named factorial
int factorial(int n){
if (n==0) // base condition
return 0;
else
return n*factorial(n-1); // recursive function call
}
Inside main function:
int x=factorial(5);
print x ------>120