#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int a, result, factorial(a);
{
cout << "please enter a number ";
cin >> a;
cout << factorial(a);
}
for(a=1; a>0; a--)
{
factorial *=a;
}
return 0;
}
xfreebornx
-23
Light Poster
Recommended Answers
Jump to PostJust wondering if you felt like reading the intro threads, and HOW TO POST CODE anytime whilst waiting for an answer.
Jump to PostCode isn't make much sense either. You define factorial as a function but then you multiply 1 and 0 to it like a variable!
And Please help doesn't state the problem. Your code is obviously flawed but we really don't know what the problem you are having is, and …
All 5 Replies
Salem
5,138
Posting Sage
wildgoose
420
Practically a Posting Shark
Hiroshe
499
Posting Whiz in Training
SeeTheLite
20
Junior Poster
kvprajapati
commented:
1. Wrong approach to help - do not throws code. 2. Source code in post #5 - is it compiled & executed?
-2
mrnutty
761
Senior Poster
kvprajapati
commented:
No need to this post - See OP's post #1. He/She has missed code tags.
-2
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.