Switch Case Example

This code is a switch case example that ask the user to enter a code and it return the type of car the user entered.

// Programa para ver que tipo de carro es por un codigo

#include <iostream>

using namespace std;

int main(){
int code;

cout << “Please enter the code: ” << endl;
cin >> code;

switch (code){
case 11:
cout << “Convertible” << endl;
break;

case 12:
cout << “Coupe” << endl;
break;

case 13:
cout << “Jeep” << endl;
break;

case 14:
cout << “Limusine” << endl;
break;

case 15:
cout << “Sedan” << endl;
break;

case 16:
cout << “Sport” << endl;
break;

case 17:
cout << “SUV” << endl;
break;

case 20:
cout << “Other” << endl;
break;

default:
cout << “Invalid Code” << endl;

}

return 0;
}

Leave a comment