Question #43884

write a programme using switch case for to check whether no. is even or odd

Expert's answer

#include<iostream>using namespace std;//main functionint main(){//loop from 0 to 9 number and check if number is odd or evenfor(int i=0;i<10;i++){// using switch case for to check whether no. is even or oddswitch(i%2){ case 0: //show resultcout << "The number "<<i<<" is even\n";break;default: cout << "The number "<<i<<" is odd\n";}}//delaysystem("pause");return 0;}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS