Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iomanip>
- #include <iostream>
- using namespace std;
- void doit();
- int main(){
- doit();
- cout << "Bye!\n\n";
- return(0);
- }
- void doit() {
- int val=0;
- do {
- cout << "Enter an integer (-999 to exit): ";
- cin >> val;
- if (val == -999){
- break;
- }
- else if (val % 2 != 0) {
- cout << val << " is an odd integer\n";
- }
- else if (val % 2 != 1) {
- cout << val << " is an even integer\n";
- }
- cout << "\n";
- } while (val >= -998);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement