Hey everyone, i'm actually new in c++ and i'm trying to write a program that calculate fatorial, but it doesn't work for me i don't know what is the mistake that i made, well here's my program i appreciate if anyone of you can tell me thank you.
'.h' libraries are deprecated. You should use cstdio, cstdlib]and [code]cmath (though I would personally use iostream and then output with std::cout instead of printf.
As far as your problem firstly I would like to mention it shouldn't compile. You need to remove the semi-colon on line 18 compiler errors should have mentioned that. Also line 19 and 20 are swapped and probably don't get a compiler for that since it would just put i in the global space but you don't need it to be global this variable is not necessary though. Though your for loop is really weird? I have no idea what you were trying to do with for(i; >0; <=x) anyways you might find a while loop easier.
1 2 3 4 5
while( x > 0)
{
Fx *= x;
--x; //or x-- on the line above instead of this line
}