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 |
How can I set an array's size at run time?
Please write the area of a RIGHT ANGLED TRIANGLE.
can u give me the good and very optimised code for a car racing game?
What are formal parameters?
write a c program to find largest of three numbers using simple if only for one time.
can u suggest me am in a confusion to choose whether to go to c programming or a software testing . am a graduate in B.sc(electronics).
How can a process change an environment variable in its caller?
What are the types of type qualifiers in c?
i want to know the procedure of qualcomm for getting a job through offcampus
How can I do serial ("comm") port I/O?
Combinations of fibanocci prime series
which one is better structure or union?(other than the space occupied )