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 |
Explain what is meant by 'bit masking'?
What is the g value paradox?
What are data structures in c and how to use them?
What is clrscr ()?
how would a 4*3 array A[4][3] stored in Row Major Order?
character array A[12] can hold
Explain the difference between null pointer and void pointer.
du u know test pattern for robosoft? Plz share
1 Answers RoboSoft, TATA, Wipro,
Explain what is #line used for?
What is modeling?
"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above
What is function pointer c?