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 |
main() { printf("hello"); fork(); }
What is the size of structure pointer in c?
Why do we need volatile in c?
What does c mean in standard form?
What are the header files used in c language?
Which is better between malloc and calloc?
#include <stdio.h> int main() { if ("X" <"x") printf("X smaller than x "); } my question is whats the mistake in this program? find it and please tell me..
Explain what math functions are available for integers? For floating point?
What is the c value paradox and how is it explained?
What is the general form of a C program?
Can u return two values using return keyword? If yes, how? If no, why?
I have one doubt. What does below statement mean? #define sizeof(operator) where operator can be int or float etc. Does this statement meaningful and where it can be used?