Develop a C program to find factorial of a given integer number using while loop.
Code
#include<stdio.h>int main(){int n,i=1,f=1;printf("\n Enter The Number:");scanf("%d",&n);//LOOP TO CALCULATE FACTORIAL OF A NUMBERwhile(i<=n){f=f*i;i++;}printf("\n The Factorial of %d is %d\n",n,f);return 0;}
Output
0 Comments
Post a Comment