Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(){
- char texto[30];
- printf("Digite um texto de ate 30 caracteres: ");
- gets(texto);
- int vogais = 0, i = 0;
- for(i = 0; i < sizeof(texto) && texto[i] != '0'; i++){
- if(texto[i] == 'a'|| texto[i] == 'e' || texto[i] == 'i' || texto[i] == 'o' || texto[i] == 'u'){
- vogais++;
- }
- if(texto[i] == 'A'|| texto[i] == 'E' || texto[i] == 'I' || texto[i] == 'O' || texto[i] == 'U'){
- vogais++;
- }
- }
- printf("Quantidade de vogais: %d", vogais);
- return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement