#include<stdio.h>
      int main()
      {
          int exam;
          printf ("Which Subject you have cleared?\nIf you cleared just maths type 1\nIf you cleared just science type 2\nIf you cleared both the subjects type 3\n");
          scanf("%d", &exam);
          switch(exam){
          case 1:
          printf("you got 15 rupees");
              break;
          case 2:
          printf("you got 15 rupees");
              break;
          case 3:
          printf("you got 45 rupees");
              break;
          default:
          printf("you got nothing");
              break;
          }
        return 0;
      }
      
      C language logo

      switch

      0

      0

      avatar
      omtajne11

      an example of switch statement

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.