what is the coding of display the factorial of a number
using array and function?
Answer / balaji ganesh
#include<stdio.h>
int fact(int m)
{
int i,f=1;
for(i=m;i>0;i--)
f=f*m--;
return f;
}
void main()
{
int n,s;
clrscr();
scanf("%d",&n,printf("enter the number:"));
s=fact(n);
printf("factorial of %d is=%d",n,s);
getch();
}
Is This Answer Correct ? | 6 Yes | 1 No |
which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;
can we define a function in structure?
Is the exit() function same as the return statement? Explain.
0 Answers Agilent, ZS Associates,
what is foreign key in c language?
Define C in your own Language.
How can I recover the file name given an open stream?
What does sizeof return c?
for(;;) printf("C language") What is out put of above??
2 Answers Practical Viva Questions,
Why doesn't C support function overloading?
What compilation do?
7 Answers Geometric Software, Infosys,
Explain how do you list files in a directory?
How can I call a function with an argument list built up at run time?