Ver Mensaje Individual
  #6 (permalink)  
Antiguo 03/05/2011, 19:58
sam90
 
Fecha de Ingreso: abril-2010
Ubicación: Rosario
Mensajes: 1.850
Antigüedad: 14 años
Puntos: 228
Respuesta: Switch elegir todas las opciones

Para mi deberias crear dos funciones X e Y.

Luego haces.
Código C:
Ver original
  1. switch (a){
  2.     case 1:
  3.     X();
  4.     break;
  5.      
  6.     case 2:
  7.     Y();
  8.     break;
  9.      
  10.     case 3:
  11.     X();
  12.     y();
  13.  
  14.     }


y si no algo sin swtch y funciones.


Código C:
Ver original
  1. if (a == 1 || a == 3) {Codigo X;}
  2. if (a == 2 || a == 3) {Codigo Y;}