Write a Program of Factorial in C++.

#include <iostream.h>
#include <conio.h>
void main(){
   clrscr();
   int i,n,fact=1;
   cout<<"enter any number:";
   cin>>n;
   for(i=0;i<n;i++){
      fact=fact*1;
   }
   cout<<"factorial is :"<<fact;
   getch();
}

Output

Factorial
Factorial
(Visited 213 times, 1 visits today)
Share with Friends :
Written by:

Leave a Reply

Your email address will not be published. Required fields are marked *