VOOZH about

URL: https://www.geeksforgeeks.org/computer-science-fundamentals/menu-driven-program-using-switch-case-c/

⇱ Menu-Driven program using Switch-case in C - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Menu-Driven program using Switch-case in C

Last Updated : 21 Jul, 2023

A Menu Driven program is a program that represents a menu of options to the user and different actions are performed based on different options. In this article, we will learn to write a Menu Driven program using Switch-case in C.

👁 Menu-Driven-program-using-Switch-case-in-C11

Menu Driven Program in C

The below program demonstrates an example of a Menu-Driven program using a Switch case to calculate:

  1. Area of a circle
  2. Area of square
  3. Area of sphere


Output

Press 1 to calculate area of circle
Press 2 to calculate area of square
Press 3 to calculate area of sphere
Enter your choice:
1
Enter radius:
5
Area of circle=78.5

Complexity Analysis

Time Complexity: O(1)
Auxiliary Space: O(1)

Related Articles

Comment