what is the coding of display the factorial of a number
using array and function?



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

Post New Answer

More C Interview Questions

Explain what is meant by 'bit masking'?

0 Answers  


What is the g value paradox?

0 Answers  


What are data structures in c and how to use them?

0 Answers  


What is clrscr ()?

0 Answers  


how would a 4*3 array A[4][3] stored in Row Major Order?

0 Answers   HCL, Ignou,






character array A[12] can hold

5 Answers   Wipro,


Explain the difference between null pointer and void pointer.

0 Answers   TCS,


du u know test pattern for robosoft? Plz share

1 Answers   RoboSoft, TATA, Wipro,


Explain what is #line used for?

0 Answers  


What is modeling?

0 Answers  


"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above

0 Answers  


What is function pointer c?

0 Answers  


Categories