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

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -