C Syntax Conditional Statements switch...case

 

- Info:

- This tutorial shows how to use "while" conditional statements.

 

- Example:

- Create C Console Application Test.c.

 

Test.c

#include <stdio.h>

int main() {

int a = 5;

switch (a) {

case 1:

printf("Value is 1. Exit from switch.\n");

break;

case 5:

printf("Value is 5. Continue to next case or default.\n");

default:

printf("Default value is selected.\n");

break;

}

return 1;

}