#include <iostream.h>
void main()
{
int i , number , factorial ;
cout<<"Enter a number :\n";
cin>>number;
for (i=1,factorial=1 ; i<=number ; i++)
factorial = factorial * i ;
cout<<"The factorial of "<<number<<" : "<<factorial;
}
Labels: C++ Basic Codes, C++ Codes, C++ Loops Codes
Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies| |
---|
0 comments:
Post a Comment