Write a program to convert C to C++ for Even or odd.
AIM: Write
a program to convert C to C++ for Even or odd.
SOURCE
CODE:
#include<iostream>
using namespace std;
int main()
{
int
n;
cout<<"\n
Enter the number:";
cin>>n;
if(n%2==0)
cout<<"\n
It is even";
else
if(n%2!=0)
cout<<"\n It is odd";
return
0;
}
Labels: oop through c++ lab
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home