KR Code Corner
Wednesday, 20 May 2015
How to make odd and even program in c++
#include<conio.h>
#include<iostream.h>
void main()
{
clrscr();
int a;
cout<<"Enter the no. to check it is odd/even.\n";
cin>>a;
if(a%2==0)
cout<<a<<"is even";
else
cout<<a<<"is odd";
getch();
}
Coding Format
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment