Skip to content

Instantly share code, notes, and snippets.

@ninpl
Created March 21, 2017 18:25
Show Gist options
  • Select an option

  • Save ninpl/161a6b7e0204a7a3c4770b2d4beeb636 to your computer and use it in GitHub Desktop.

Select an option

Save ninpl/161a6b7e0204a7a3c4770b2d4beeb636 to your computer and use it in GitHub Desktop.
Estructura condicional multiple
// Practica para refrescar la sintaxis de C++
#include <iostream>
using namespace std;
int main()
{
//ESTRUCTURA CONDICIONAL MULTIPLE
char variable;
cin>>variable;
switch(variable)
{
case '1': cout<<"Caso 1"<<endl;
break;
case '2': cout<<"Caso 2"<<endl;
break;
case '3': cout<<"Caso 3"<<endl;
break;
default: cout<<"Ningun caso"<<endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment