Answers for "Code Example of Switch Statement in C++/Java"

C++
0

Code Example of Switch Statement in C++/Java

#include 
using namespace std;
 
int main () {
  
   int markz = '90';

   switch(grade) {
      case '5' :
         cout << "You scored 5 markz " << endl; 
         break;
     
      case '7' :
         cout << "You scored 7 markz " << endl;
         break;
      case 'D' :
         cout << "You scored 10 markz " << endl;
         break;
      default :
         cout << "You scored 0 markz " << endl;
   }
   cout << "Your marks is " << markz << endl;
 
   return 0;
}
Posted by: Guest on April-10-2022

Code answers related to "Code Example of Switch Statement in C++/Java"

Browse Popular Code Answers by Language