Write a C++ program to check whether a given number is even or odd.

Write a C++ program to check whether a given number is even or odd.

Write a C++ program to check whether a given number is even or odd.

Answer : 
File Name : c.cpp

#include<stdio.h>
#include<conio.h>
#include<iostream>
using namespace std;
int a,b;
int main(){
cout<<"ENTER NUMBER : ";
cin>>a;
if(a%2==0)
cout<<a<<" IS EVEN NUMBER"<<endl;
else
cout<<a<<" IS ODD NUMBER"<<endl;
}
Write a C++ program to check whether a given number is even or odd. Write a C++ program to check whether a given number is even or odd. Reviewed by technical_saurabh on May 02, 2021 Rating: 5

No comments:

Powered by Blogger.