Earn without any Investment!
Programming
Saturday, November 13, 2010
Factorial of a given number
#include<iostream.h>
#include<conio.h>
void main()
{
int n,fact=1,i;
clrscr();
cout<<"Enter a Number:";
cin>>n;
for(i=1;i<=n;i++)
{
fact=fact*i;
}
cout<<"Factorial :"<<fact;
getch();
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment