Q19. Write a C++ program to accept a number and determine whether it is even or odd.
#include<iostream.h> //standard input/output header file
#include<conio.h> //for clrscr()
clrscr(); //for clearing the screen
cout<<“\n Enter a number: “;
a%2==0? cout<<“\n It is an even number.” : cout<<“\n It is an odd number.”;
getch(); //holds the screen until any key is pressed
return 0; //makes main() finish
Enter a number: 7
It is an odd number.
Enter a number: 6
It is an even number.