- #1
Urmi Roy
- 753
- 1
Homework Statement
To write a C++ program to find the factorial of the number input 'a'.
Homework Equations
the factorial evaluated is denoted as 'f'
i is the counter
The Attempt at a Solution
Pls check if my program is correct...(here f is the value of factorial and a is the number whose factorial is to be found...)
#include<iostream>
int f
int a
int i
void main()
{cout<<"Enter a number:<<a;
cin>>a;
for(i=0,i<a;i++)
{f=a;
f=f*i;
}
cout<<f;
end1
}
Please tell me if this is okay.