Write a Program in C++ to input a number and check whether that number is EVEN or ODD.
Answers
Answered by
1
/*
* C++ program to check if given integer is even or odd
*/
#include
using namespace std;
int main()
{
int number, remainder;
cout << "Enter the number : ";
cin >> number;
remainder = number % 2;
if (remainder == 0)
cout << number << " is an even integer " << endl;
else
cout << number << " is an odd integer " << endl;
return 0;
}
Please mark me as brianliest
* C++ program to check if given integer is even or odd
*/
#include
using namespace std;
int main()
{
int number, remainder;
cout << "Enter the number : ";
cin >> number;
remainder = number % 2;
if (remainder == 0)
cout << number << " is an even integer " << endl;
else
cout << number << " is an odd integer " << endl;
return 0;
}
Please mark me as brianliest
Answered by
1
Explanation:
C++ Program to Check if a given Integer is Even or Odd
/*
* C++ program to check if given integer is even or odd.
#include<iostream>
using namespace std;
int main()
{
int number, remainder;
cout << "Enter the number : ";
Similar questions
India Languages,
12 hours ago
English,
12 hours ago
Biology,
23 hours ago
Computer Science,
23 hours ago
Physics,
8 months ago
Math,
8 months ago
Music,
8 months ago