You can make it smaller. When I make programs I don't add the line do{ and the space above the int main is not required. It's just to make it look good. And I don't really understand the i!=0 either. I usually use namespace Std and the system pause.
Code:#include <iostream> using namespace std; int main () { int i; cout << "Type a number (0 to exit): \n"; cin >> i; if ((i%2)!=0) cout << "Number is odd.\n"; else cout << "Number is even.\n"; while (i!=0); return 0; }






Reply With Quote

Bookmarks