Toggle navigation
Home
Latest pastes
FAQ
Random
Register
Login
Example Program For Factorial Value Using For Loop In C++
SUBMITTED BY:
Nrupeshsinh
DATE:
June 24, 2016, 8:24 a.m.
FORMAT:
Text only
SIZE:
438 Bytes
Raw
Download
Tweet
HITS:
654
Go to comments
Report
#include<conio.h>
using namespace std;
int main()
{
// Variable Declaration
int counter, n, fact = 1;
// Get Input Value
cout<<"Enter the Number :";
cin>>n;
//for Loop Block
for (int counter = 1; counter <= n; counter++)
{
fact = fact * counter;
}
cout<<n<<" Factorial Value Is "<<fact;
// Wait For Output Screen
getch();
return 0;
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus