Gustavo-Augusto

Lista 04 – exercicio 18

Jun 28th, 2013
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. int main ()
  2. {
  3.     int i,cont=0;
  4.     char nome[50];
  5.     printf ("Digite seu nome: ");
  6.     gets (nome);
  7.     for (i=0;i<50;i++)
  8.     {
  9.         if (nome[i]==' ')
  10.             continue;
  11.         else if (nome[i]=='\0')
  12.             break;
  13.         else if (nome[i]=='a'||nome[i]=='e'||nome[i]=='i'||nome[i]=='o'||nome[i]=='u')
  14.             cont++;
  15.         else
  16.             continue;
  17.     }
  18.     printf ("o nome '%s' tem %d vogais.\n\n",nome,cont);
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment