Computer Science, asked by misscutie94, 6 months ago

Write a programme in C++ to input any number and to print whether it is ODD or EVEN.
➡️ Wrong Answer will be reported​

Answers

Answered by 8472
2

Answer:

class num

{

public static void main( int a)

{

if( a>0)

System.out.println("Num is positive ");

else if(a>0)

System.out.println(" Num is negative ");

else

System.out.println(" Num is zero");

}}

Hope it helps pls mark it as brainliest and follow me....

Answered by Vyomsingh
4

QUESTION:→

  • Write a programme in C++ to input any number and to print whether it is ODD or EVEN.

_____________________________

Logic Used

if n%2==0

n is Even.

otherwise Odd.

______________________________

Code➛

#include<iostream>

using namespace std;

int main()

{

int number, remainder;

cout << "Enter the number : ";

cin >> num;

if (num%2== 0)

cout << number << " is an even number " << endl;

else

cout << number << " is an odd number " << endl;

return 0;

}

___________________________

Input:-

88

Output:-

88 is an even number

Similar questions