Sunday, July 31, 2016

FACTORIAL OF A NUMBER- C Language

/* FACTORIAL OF A NUMBER*/

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j=1,fact=1;
clrscr();
printf("\n Enter the no.::");
scanf("%d",&i);
while(j<=i)
{
fact=fact*j;
j++;
}
printf("The Factorial of the number is %d",fact);
getch();
}

/************************OUTPUT***************************
Enter the no.::5
The Factorial of the number is 120*/

No comments:

Post a Comment