/* C plus plus program to check whether a given integer is odd or even*/
#include<iostream>
#include<conio.h>
using namespace std;
void main()
{
int number, remainder;
cout<<"Enter an integer : ";
cin>>ival;
remainder = number % 2;
if(remainder == 0)
{
cout<<number
<<" is an even integer\n";
}
else
{
cout<<number
<<" is an odd integer\n";
}
getch();
}
#include<iostream>
#include<conio.h>
using namespace std;
void main()
{
int number, remainder;
cout<<"Enter an integer : ";
cin>>ival;
remainder = number % 2;
if(remainder == 0)
{
cout<<number
<<" is an even integer\n";
}
else
{
cout<<number
<<" is an odd integer\n";
}
getch();
}
0 Questions:
Post a Comment