Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 40121

Why I'm getting runtime error?

$
0
0

include <iostream>

using namespace std;

int factorial (int temp);

int main() { int n,t; long long int q; cin>>t; while(t--) { cin>>n; for(int i=0;i<n;i++) cin="">>q; int a=factorial(n); int b=factorial(n-2); b=b2; //if(n!=1) cout<<(a/b); //else cout<<1; } return 0; } int factorial(int temp) { int n=2,ans=1; if(temp<2) return 1; while(temp>=n) { ans=ansn; cout<<"ans="<<ans<<endl; n++; } return ans; }

why i'm i getting runtime() error???


Viewing all articles
Browse latest Browse all 40121