Write a program that could find whether the number entered through keyboard is odd or even the program should keep on taking the
value till the user ends.
1 answer:
Answer:
using namespace std;
int main() {
int number;
while (1) {
cout << "Enter a number: ";
cin >> number;
cout << number << " is " << ((number % 2) ? "odd" : "even") << endl;
};
return 0;
}
Explanation:
This is a c++ version. Let me know if you need other languages.
The (number % 2) is the essence of the program. It returns 0 for even numbers, and 1 for odd numbers (the remainder after division by 2).
You might be interested in
I believe the answer is A but i am not too sure :/
Answer:
B
Explanation:
This feels like an error on the question issuer's part.
Answer:
You just need to look at the pro pga amd determine it from there
Explanation:
I have no idea what what im saying but i sound smart right
Answer:
100BaseT
Also called Fast Ethernet
Good luck...
Answer:
A.Datasheet
Explanation:
I hope it's helpful