63 133
Assignments Done
99,1%
Successfully Done
In July 2018

Answer to Question #15481 in C++ for Aadya

Question #15481
write a program to find whether a given number is even or odd.
Expert's answer
#include<iostream.h>

bool even(int i){
if (i%2==0) return true;
else return false;
}

int a;

void main(){
cout<<"Enter an integer: ";
cin>>a;
if (even(a)) cout<<"Entered integer is even.\n";
else cout<<"Entered integer is odd.\n";
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions