#Include Using Namespace STD Int Main (Int N Cout N If (N % 2 0) Cout N " Is Even." Else Cout N " Is Odd." Return 0 )
This C++ program asks the user to input an integer, uses the modulo operator to check if it is even or odd, and prints out a statement indicating whether the number is even or odd. It takes in a user-input number, tests if it is divisible by 2 without a remainder, and outputs a message stating whether the number is even or odd.
We take content rights seriously. If you suspect this is your content, claim it here.
0 ratings0% found this document useful (0 votes)
65 views1 page
#Include Using Namespace STD Int Main (Int N Cout N If (N % 2 0) Cout N " Is Even." Else Cout N " Is Odd." Return 0 )
This C++ program asks the user to input an integer, uses the modulo operator to check if it is even or odd, and prints out a statement indicating whether the number is even or odd. It takes in a user-input number, tests if it is divisible by 2 without a remainder, and outputs a message stating whether the number is even or odd.