Saturday, 18 August 2012

factorial


#include<iostream>
#include<conio.h>
using namespace std;
void main()
{
int i=2,j,n,a=1,b,c,d;
char p,q,e;
cout<<"enter the  no to be calculated for factorial";
cin>>n;
while(i<=n)
{
a=a*i;
i++;


}


cout<<a;
getch();
}

No comments:

Post a Comment