write a program using switch statement to performe the following input 1,2,3 output display your name, display your favorite passion, display favorite character how to write in cw
Answers
Answered by
0
The switch case statement is used when we have multiple options and we need to perform a different task for each option.
C – Switch Case Statement
Before we see how a switch case statement works in a C program, let’s checkout the syntax of it.
switch (variable or an integer expression)
{
case constant:
//C Statements
;
case constant:
//C Statements
;
default:
//C Statements
;
}
Example of Switch Case in C
Let’s take a simple example to understand the working of a switch case statement in C program.
its the answer.....
Attachments:
Similar questions