Excellent Code
simply excellent ...
Pages
Home
Request for more
C++ : check whether a number is odd or even
#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
int n;
cout<<"Enter any number : ";
cin>>n;
if(n%2==0)
cout<<n<<" is even";
else
cout<<n<<" is odd";
getch();
return(0);
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment