Practical No.-6
Aim

: To demonstrate the program to check the
Even & odd numbers.

Source code :

#include<iostream.h>
#include<conio.h>
void main()
{
int a;
cout <<”Enter the value of a”;
cin >>a;
if (a%2=0)
cout<<”the number is an even number”;
else if(a%5=0)
cout<<”the number is an odd number”;
}

Output

:

Enter the value of a =4
the number is an even number
Enter the value of a=3
the number is an odd number
Practical no 6

Practical no 6

  • 1.
    Practical No.-6 Aim : Todemonstrate the program to check the Even & odd numbers. Source code : #include<iostream.h> #include<conio.h> void main() { int a; cout <<”Enter the value of a”; cin >>a; if (a%2=0) cout<<”the number is an even number”; else if(a%5=0) cout<<”the number is an odd number”; } Output : Enter the value of a =4 the number is an even number Enter the value of a=3 the number is an odd number