#include<iostream> using namespace std; int fact(int); int fact (int n){ int i,f=1; for(i=1;i<=n;i++) { f=f*i; } return f; } int main(){ int n,m; cout<<"Enter number"<<endl; cin>>n; m=fact(n); cout<<"Factorial of a number is"<<m<<endl; return 0; }
If compiles for me too using C++ 4.3.2 and C++ 14.
What compiler shows the error, and what is the error it shows?
It’s not error. It’s a Wrong Answer.: https://www.spoj.com/status/FCTRL,pm_brandy_pics/ @pm_brandy_pics, yours program counts factorial, but task is to count zeros, only zeros in a factorial
oopsies thanks mate