write a c program to input a number and calculate its factorial using for loop
Answers
Answered by
2
Answer:
#include <stdio.h >
int main ()
{
int n, fact=1;
printf ("enter a number") ;
scanf ("%d", &n) ;
for(int i=1;i<=n;i++)
fact=fact *i;
printf ("%d", fact) ;
}
Similar questions