Course Content
Detailed Content of Programming in C
0/1
Introduction
0/1
Structure of C program
0/1
Answers of ‘C’ Pointers Programs
0/1
About Lesson

Programs using Switch Statements:

1. Write a program that takes a grade (A, B, C, D, or F) as input and prints a corresponding message using a switch statement.

2. Write a program that takes a number (1 for Monday, 2 for Tuesday, etc.) as input and displays the corresponding day of the week using a switch statement. 

3. Develop a calculator program that takes two numbers and an operator (+, -, *, /) as input. Use a switch statement to perform the corresponding operation.

4. Write a program that takes an uppercase alphabet letter as input and converts it to lowercase, and vice versa, using a switch statement.

5. Develop a program that takes a month number (1 to 12) as input and prints the corresponding season (spring, summer, autumn, winter) using a switch statement.

6. Write a program that simulates a traffic light. The user inputs the color (red, yellow, or green), and the program prints the corresponding message using a switch statement.