Question: Write a program that will accept an integer as input from the user and test if that input is an even number. It should also
- Write a program that will accept an integer as input from the user and test if that input is an even number. It should also test if the input is evenly divisible by 6. The program should display Even if the users input is even. It should additionally display divisible by 6 if the users input is evenly divisible by six.
#include
using namespace std;
int main(){
return 0;
}
- Convert the following switch statement to an if- else if else statement:
int value;
switch (value) {
case 6:
cout << "The value is 6" << endl;
break;
case 5:
cout << "The value is 5" << endl;
break;
case 4:
cout << "The value is 4" << endl;
break;
default:
cout << "The default was chosen" << endl;
} // end of switch() statement
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
