Wednesday, 17 July 2013


#include "stdafx.h"
#include "stdio.h"
#include "iostream"
#include "conio.h"

using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
int n;
int f=1;
cout<<"enter a number";
cin>>n;
for(int c=1;c<=n;c++)
f=f*c;
cout<<"factorial is : "<<f<<endl;
getch();
}
Reactions:

0 comments :

Post a Comment