65 721
Assignments Done
99,2%
Successfully Done
In October 2018

Answer to Question #43884 in C++ for pooja bagde

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 function
int main()
{
//loop from 0 to 9 number and check if number is odd or even
for(int i=0;i<10;i++){
// using switch case for to check whether no. is even or odd
switch(i%2){
case 0:
//show result
cout << "The number "<<i<<" is even\n";
break;
default:
cout << "The number "<<i<<" is odd\n";
}
}
//delay
system("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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions