0 votes
50 views
in C Programming by (35 points)
edited by

Explain the syntax and use of switch Statement with suitable example

Please log in or register to answer this question.

1 Answer

0 votes
by (21.6k points)

In computer programming languages, a switch statement is a type of selection control mechanism used to allow the value of a variable or expression to change the control flow of program execution via search and map.

switch( expression )
{
    case value-1:
            Block-1;
            Break;
    case value-2:
            Block-2;
            Break;
    case value-n:
            Block-n;
            Break;
    default:
            Block-1;
            Break;
}
Statement-x;

Related questions

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...