plz answer..... a program that reads non-negative integer
and computes and prints its factorial
Answer Posted / valli
//using recursion
fact(int);
main()
{
int n;
printf("enter n");
scanf("%d",n)
if(n<0)
printf("invalid number");
else
printf("factorial of %d =%d",n,fact(n));
}
fact(int n)
{
if(n==0||n==1)
return 1;
else
return n*fact(n-1);
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Do you know what are bitwise shift operators in c programming?
Is c object oriented?
how to build a exercise findig min number of e heap with list imlemented?
What is the newline escape sequence?
What is the use of ?
Does * p ++ increment p or what it points to?
Why doesnt that code work?
Linked lists -- can you tell me how to check whether a linked list is circular?
Do you have any idea how to compare array with pointer in c?
I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.
Can you write the function prototype, definition and mention the other requirements.
What is type qualifiers?
Iam a B.Tech graduate and completed my engineering in 2009, from 2005 to 2009 and after that i had done nothing.Now i want to do job and get into BPO field . Friends give me suggestions as what to say in interview... if they ask me that what would you had done ... these many years without doing job ??????? pls urgent
Who invented bcpl language?
Is c easier than java?