pablosotol

Guia Programacion 1 - Ejercicio 5

Mar 31st, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.47 KB | None | 0 0
  1. #include<stdio.h>
  2. int main(){
  3.     int m,cont=0;
  4.     char x;
  5.     while(m!=1){
  6.     printf("\nIngrese una letra:  ");
  7.     scanf("%c",&x);
  8.     fflush(stdin);
  9.     switch(x){
  10.     case 'a': cont++;
  11.     break;
  12.     case 'e': cont++;
  13.     break;
  14.     case 'i': cont++;
  15.     break;
  16.     case 'o': cont++;
  17.     break;
  18.     case 'u': cont++;
  19.     break;
  20.     case '#': m=1;
  21.     break;
  22.     default:
  23.     break;
  24.     }
  25.     }
  26.     printf("\nHay %d vocales",cont);
  27.     return 0;
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment