write a C++ program to accept a four digit number and print whether it is odd or even number. Write a program to print the digits of the number in reverse order. (e.g 1234 is an even number. The reverse of the numbers 4321).
1
Expert's answer
2016-06-24T08:37:03-0400
#include <iostream> using namespace std; int main() { int n = 0; //Obtaining the number n cout << "Enter an integer number:"; cin >> n; //if the remainder of the division by 2 is 1, then the number is even, else - odd if (n % 2) cout << "The number is odd."; else cout << "The number is even."; return 0; }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment