/*PROGRAM TO PRINT THE FACTORIAL OF A NUMBER*/
#include
#include
void main()
{
long int fact=1,no,i;
clrscr();
printf("ENTER THE NUMBER=");
scanf("%li",&no);
for(i=1;i<=no;i++)
fact=fact*i;
printf("\n\n\nFACTORIAL OF A NUMBER=%li",fact);
getch();
}
/****************OUTPUT*****************
ENTER THE NUMBER=5
FACTORIAL OF A NUMBER=120
*/
No comments:
Post a Comment