|
|
back to boardCompilation Error..Please help I have written this code in C++, and its running fine in Bloodshed DEV C++ and code::blocks. Then why am i getting compilation error whenever i submit it? Please help. #include<iostream> #include<conio.h> using namespace std; int main() { int n,j=0,i,m,r; long long fact=1; char space,c; n=getch(); n=n-48; cout<<n; space=getche(); c=getche();
while(c=='!') { c=getche(); j++; } cout<<endl; if(n%j==0) { i=0; m=n; while(m>=j) { fact=fact*m; i++; m=(n-(i*j)); } } else { i=0; m=n; r=n%j; while(m>=r) { fact=fact*m; i++; m=(n-(i*j)); } } cout<<fact<<"\n"; system("pause"); return 0; } Thanks in advance. Regards, Shalini Sah |
|
|