Answered step by step
Verified Expert Solution
Link Copied!

Question

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 to Expert-Tailored Solutions

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

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

3rd Edition

0471418455, 978-0471418450

Students also viewed these Databases questions