Twitter Feed Facebook Google Plus Youtube

Adsense responsive

Recent Post below header

Tuesday 29 January 2013

C PROGRAM: TO CALCULATE FACTORIAL OF ANY NUMBER

CODING:
#include<stdio.h>
#include<conio.h>
void main()
{
int num,i,fac;

clrscr();
printf("Enter any number ");
scanf("%d",&num);
fac=1;
for(i=1;i<=num;i++)
{
 fac=fac*i;
}
printf("\nFactorial of %d is =  %d",num,fac);
getch();
}


CODING


output image
OUTPUT

For any query or suggestion please comment below...

No comments:

Post a Comment