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

  1. 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;

}

  1. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!