Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
1.00/5 (5 votes)
See more:
Write a program that take a number from user and display the number is even or odd using IF-ELSE statement.

What I have tried:

Write a program that take a number from user and display the number is even or odd using IF-ELSE statement.
Posted
Updated 29-Nov-23 6:08am
v2
Comments
merano99 29-Nov-23 11:32am    
Have you tried to write the program? Please show the attempt here and ask a specific question. If someone were to write the program for you, you would hardly make any progress.

You tried nothing.
Have a look at C++ If ... Else - W3 Schools[^].
Also, the modulus operator (%) is your friend.
 
Share this answer
 
Comments
Andre Oosthuizen 29-Nov-23 12:09pm    
+5, link to basic stuff to start a homework assignment.
CPallini 29-Nov-23 13:31pm    
Thank you.
If your first basic homework assignment is too hard for you, you may want to consider another subject.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900