Thanks to visit codestin.com
Credit goes to www.scribd.com

0% 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.

Uploaded by

Abel Yifat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
0% 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.

Uploaded by

Abel Yifat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
You are on page 1/ 1

#include <iostream>

using namespace std;

int main()

int n;

cout << "Enter an integer: ";

cin >> n; if ( n % 2 == 0)

cout << n << " is even.";

else

cout << n << " is odd.";

return 0;

You might also like