Home Basic Loop Array string Function Pointer Contact STUDY

AHF    C    PROGRAM    SOLVING

Programming tips

Iterative statement



" ; " after loop



Working with switch case



Specifer



Comment




Factorial of an integer number




// AHF C PROGRAM SOLVING

//solving here ITERATIVES STATEMENTS type of programming problem

#include<stdio.h> #include<math.h> #define pf printf int main() { int n,j,fact=1; //taking the number to continue loop pf("Enter any integer number: "); scanf("%d",&n); for(j=1;j<=n;j++) fact*=j; pf("\nThe factorial of %d is : %d",n,fact); return 0; }
OUTPUT:


© 2018 - All rights reserved