Wednesday, March 28, 2018

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:

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home