Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* CABEÇALHO
- Arquivo: LISTA 05 - Exercicio 14.c
- Objetivo: Exiba todos os nomes que começam por vogal.
- Autor(a): Ramon Borges
- */
- #include <stdio.h>
- #include <string.h>
- #define LIN 10
- #define COL 10
- int main()
- {
- char nomes[LIN][COL];
- int i = 0, j, resul;
- do
- {
- printf("Insira um nome (digite fim para sair): ");
- gets(nomes[i]);
- resul = strcmp(nomes[i], "fim");
- i++;
- }while(resul);
- for(i = 0; i < LIN; i++)
- for(j = 0; j < 1; j++)
- {
- if(nomes[i][j] >= 'a' && nomes[i][j] <= 'z')
- nomes[i][j] -= 32;
- if(nomes[i][j] == 'A' || nomes[i][j] == 'E' || nomes[i][j] == 'I' || nomes[i][j] == 'O' || nomes[i][j] == 'U')
- printf("\n%s", nomes[i]);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment