2:10 PM
C++ Program to calculate FACTORIAL OF A NUMBER

 

Write a Program to calculate FACTORIAL OF A NUMBER

#include<iostream.h> 
#include<conio.h> 
 
 
void main()
{
int i=1,f=1,num;
clrscr();
printf("\nEnter a number:");
scanf("%d",&num);
while(i<=num)
{
f=f*i;
i++;
}
printf("\nFactorial of %d is:%d",num,f);
getch();
}
 
 
Note:    
           If you want to change in this program please write through the comment on this page. you can also past similar program of 
             c++ with output.your comment is valuable to the other user and person.
Views: 89 | Added by: vijoriya | Tags: c++, FACTORIAL, Number, program, calculate | Rating: 0.0/0
Total comments: 0
avatar