c++ - Returning zero from main breaks my program -
i begin learn c++, main method do:
#include <iostream> using namespace std; int main () { int d; int n; cout <<"enter denominator: " << endl; cin >> d; cout <<"enter numerator: " << endl; cin >> n; cout <<"the result of operation is: " << endl; cout << (double)n/d << endl; cout <<"done"; return 0; }
it doesn't produce output, if delete return 0. generate correct output. shouldn't main method in c++ return integer eventually?
i went through code , seems right. when run it, works fine. if haven't solved yet try cut , past code new project. know sounds stupid should work.
i hope you.
Comments
Post a Comment