Computer Science, asked by Wahib2247, 5 months ago

Write any program in c++ containing switch​

Answers

Answered by Anonymous
1

The switch statement allows us to execute a block of code among many alternatives.

The syntax of the switch statement in C++ is:

switch (expression) {

case constant1:

// code to be executed if

// expression is equal to constant1;

break;

case constant2:

// code to be executed if

// expression is equal to constant2;

break;

.

.

.

default:

// code to be executed if

// expression doesn't match any constant

}

Similar questions