- 1
Why this code doesn’t work ?(factorial)
What is problem with this code(factorial) https://code.sololearn.com/cb3y5047086H/?ref=app #include <iostream> using namespace std; int f(int a,int i) { int a; for(i=1;i<a;i++) a =a*i; return a; } int main() { int a,i; cin>>a; f(a,i); cout<<f(a,i); }
2 Answers
+ 1
Amirhossein Omidi yekta you have duplicate questions?also you should learn the basic syntax or atleast learn to read the errors or you won't be able to understand anything as can be seen from the mistakes in this code:-)
0
You are not initialising i. You don't have to pass it to the function. You can just pass the a value.
Hot today
I have made a calculator in which my % (Percentage) not work correctly for 100%50 or 100%20.
2 Votes
Python palindrome challenge.
1 Votes
Java
0 Votes
Number of Ones ( C++ ) question!
1 Votes