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

Recommended Answers

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

Jump to Post

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";
else
cout<<"odd number";

hope these hints help you.

Be a part of the DaniWeb community

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