#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a,b;
cout<<“Enter the number “;
cin>>a;
b=a%2;
switch(b)
{
case 0:
cout<<“This number is even “;
break;
case 1:
cout<<“This number is odd “;
break;
default:
cout<<“Enter correct value “;
break;
}
getch();
}
#include<conio.h>
void main()
{
clrscr();
int a,b;
cout<<“Enter the number “;
cin>>a;
b=a%2;
switch(b)
{
case 0:
cout<<“This number is even “;
break;
case 1:
cout<<“This number is odd “;
break;
default:
cout<<“Enter correct value “;
break;
}
getch();
}
No comments:
Post a Comment