Lab exercise programs in C plus plus
Please visit http://csprograms.in/ for more Computer Science programs.
Welcome..!!
Please visit
http://csprograms.in/
for more Computer Science programs.
Showing posts with label
odd
.
Show all posts
Showing posts with label
odd
.
Show all posts
Wednesday, 14 March 2012
9. C++ program to find if the given number is even or odd.
#include <iostream>
int main()
{
int p,q;
cout <<"enter the number \n";
cin >>p;
cout <<"the given number is \n"<<n;
q=p%2;
if(q==0)
cout << p<<" is even number \n";
else
cout <<p<<" is odd number \n";
return 0;
}
Older Posts
Home
Subscribe to:
Posts (Atom)