program to check whether a no. is even or odd

1
// Program to check whether a no. is even or odd. #include <iostream.h> #include <conio.h> void main() { clrscr(); int num; cout<<"\n Enter the no. you want to check: "; cin>>num; if ((num%2)==0) {cout<<" \nThe no. is even"; } else {cout<<" \nThe no. is odd"; } getch(); }

Upload: swarup-boro

Post on 22-Jan-2018

255 views

Category:

Education


2 download

TRANSCRIPT

Page 1: Program to check whether a no. is even or odd

// Program to check whether a no. is even or odd.

#include <iostream.h>#include <conio.h>void main(){clrscr();int num;cout<<"\n Enter the no. you want to check: ";cin>>num;if ((num%2)==0){cout<<" \nThe no. is even";} else{cout<<" \nThe no. is odd";} getch();}