Problem Description
To print the factorial of the given number using pointersCODING ARENA
#include <stdio.h>
int main()
{
int i,f=1,n;
scanf("%d",&n);
for(i=1;i<=n;i++)
f=f*i;
printf("%d",f);
return 0;
}
Test Case 1
Input (stdin)5
Expected Output120
Test Case 2
Input (stdin)7
Expected Output5040
No comments:
Post a Comment