// this program is to calculate factorial using while and for loop #include int main(){ int num,product=1;// declaring and initialising puts("Enter The Number "); scanf("%d ",&num) //_______________________________________________________While Loop______________________________________________ while(num>0) // if condition is true it will execute the loop else exit the loop { product=product*num; num =num-1; } //_____________________________________________For Loop__________________________________________________________ for(num; num>0; num--) product=product*num; //________________________________________________________________________________________________________________ printf("FActorial is %d ",product); }