Answer this question in comment plzzz....
Write a program to calculate factorial of a given number using function.
#include<stdio.h>
void fact (void);
int main( )
{
fact( );
return0;
}
void fact( )
{
int n, i, f=1;
printf(“Enter any number”);
scanf(“%d”, &n);
for(i=1; i<=n; I++)
{
f=f*i;
}
printf(“Factorial is %d”, f);
}
0 Comments
I really appreciate for your words. Thank you very much for your comment.