Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions