write a program that finds the factorial of a number using
recursion?
Answer Posted / danish
>
#include<conio.h>
int fact(int);
void main()
{
int num,fact1;
clrscr();
printf("Enter a value of num");
scanf("%d",&num);
fact1=fact(num);
printf("factorial=%d",fact1);
}
int fact(int n)
{
if(n==0)
{
return 1;
}
else
{
return
| Is This Answer Correct ? | 13 Yes | 8 No |
Post New Answer View All Answers
What does typeof return in c?
What is the value of h?
Why is this loop always executing once?
What is the use of a static variable in c?
What does %d do in c?
What was noalias and what ever happened to it?
What are structure types in C?
What is extern variable in c with example?
what are # pragma staments?
what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?
program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)
What are formal parameters?
What is the correct code to have following output in c using nested for loop?
What Is The Difference Between Null And Void Pointer?
write an algorithm to display a square matrix.