Write a programme in C++ to input any number and to print whether it is ODD or EVEN.
➡️ Wrong Answer will be reported
Share
Write a programme in C++ to input any number and to print whether it is ODD or EVEN.
➡️ Wrong Answer will be reported
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
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....
Verified answer
QUESTION:→
_____________________________
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