Advertisement
iamoran

switch

Aug 26th, 2019
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdio.h>
  3.  
  4. using namespace std; //i dont know why this is  necessary  
  5.  
  6.  
  7. int main ()
  8. {
  9.     char vocal; //defino vocales
  10.     cout<<"Introduzca una vocal minuscula:\n";
  11.     cin>>vocal;
  12.    
  13.     switch (vocal)
  14.     {
  15.         case 'a':
  16.             cout<<"La vocal es la a\n";
  17.         break;
  18.         default:
  19.             cout<<"no hay vocal\n";
  20.         break;
  21.     }
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement