accept a number and display if it an odd or even number.???

Recommended Answers

All 2 Replies

This is really simple. You can at least try! :)

everybody here knows the solution but we won't give you the exact solution.
use this as a hint:-

if the number is evenly divisible(reminder =0) by 2 then it will be even otherwise odd.

the key element in the program is modulus operator.

for more information on operator, read my tutorial Here.

now see this:

for conditions you can if statement like:

if(number is evenly divisilbe i.e. reminder=0 after divide by 2)
cout<<"even number";
cout<<"odd number";

hope these hints help you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.