0% found this document useful (0 votes)
51 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)
51 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

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy