#include<stdio.h>
      int main()
      {
          printf("\n\n\t\tStudytonight - Best place to learn\n\n\n");
          // Local Variable Definition
          char grade;
          printf("Enter your grade:\n");
          scanf("%c", &grade);
          switch(grade)
          {
              case 'A':
                  printf("Excellent\n");
                  break;
              case 'B':
                  printf("Keep it up!\n\n");
                  break;
              case 'C':
                  printf("Well done\nbreak keyword takes execution to exit the switch case\n\n");
                  break;
              case 'D':
                  printf("You passed\n");
                  break;
              case 'F':
                  printf("Better luck next time\n");
                  break;
              default:
                  printf("Invalid grade\n");
          }
          printf("Your grade is %c\n",grade);
          printf("\n\n\t\t\tCoding is Fun !\n\n\n");
          return 0;
      }
      
      Apex language logo

      SWITCH USE

      0

      0

      avatar
      natalie19970

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.