// conditional operator
#include <iostream>
usingnamespace std;
int main ()
{
int a,b,c;
a=2;
b=7;
c = (a>b) ? a : b;
cout << c;
return 0;
}
As you see here I have no errors at all and it keeps on skipping the cmd instead of showing it for more than 1 second. Whats the problem, am I missing something?
On windows the console window automatically shut down when the program ends. I think you can change some settings to make it stay open. If you run it from an IDE there is probably some IDE settings you change. If you first open the command prompt and start the program from there you will also be able to see the output.