Hello, my John Strobel. I started teaching myself C++ with books and tutorials earlier this week. I had written a sample code from a book and ran it, it takes the imput but never produces output after i hit enter. I apologize for such a trivial question, but how do I run the program from a command line prompt, or window? Instead of compile and run.
Thank you for any help, I may be a bit short sighted with something so simple
#include <iostream>
using namespace std;
int n, remainder;
//Get a number from the keyboard
cout << "Enter a number and press ENTER: ";
cin >> n;
//Get remainder after dividing by 2
remainder = n % 2;
//If remainder is 0 then number imput is 7
if (remainder == 0)
cout <<"the number is even. ";
else
cout << "The number is odd. ";
return 0;