ramontricolor12

LISTA 05 - Exercício 14

Jul 8th, 2013
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.81 KB | None | 0 0
  1. /* CABEÇALHO
  2.    Arquivo: LISTA 05 - Exercicio 14.c
  3.    Objetivo: Exiba todos os nomes que começam por vogal.
  4.    Autor(a): Ramon Borges
  5.  */
  6.  
  7. #include <stdio.h>
  8. #include <string.h>
  9. #define LIN 10
  10. #define COL 10
  11. int main()
  12. {
  13.     char nomes[LIN][COL];
  14.     int i = 0, j, resul;
  15.     do
  16.     {
  17.         printf("Insira um nome (digite fim para sair): ");
  18.         gets(nomes[i]);
  19.         resul = strcmp(nomes[i], "fim");
  20.         i++;
  21.     }while(resul);
  22.  
  23.     for(i = 0; i < LIN; i++)
  24.         for(j = 0; j < 1; j++)
  25.         {
  26.             if(nomes[i][j] >= 'a' && nomes[i][j] <= 'z')
  27.                 nomes[i][j] -= 32;
  28.             if(nomes[i][j] == 'A' || nomes[i][j] == 'E' || nomes[i][j] == 'I' || nomes[i][j] == 'O' || nomes[i][j] == 'U')
  29.                 printf("\n%s", nomes[i]);
  30.         }
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment