Question #43884
write a programme using switch case for to check whether no. is even or odd
1
Expert's answer
2014-07-02T14:18:11-0400
#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!

Comments

No comments. Be the first!
LATEST TUTORIALS
APPROVED BY CLIENTS