Thursday, March 24, 2016

Factorial C Program Using Loop


Implement a program that scan a inter number and print the factorial result .




 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
#include <stdio.h>

int main () {

int a ;
int i=1,j=1;

printf("plz enter a inter number");
scanf("%d",&a);

for (i=1 ; i<=a ; i++) {
    j=j*i;
}

printf("the factorial result = %d\n",j);
return 0 ;

}


Share this

0 Comment to "Factorial C Program Using Loop"

Post a Comment