Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(){
  4. char texto[30];
  5. printf("Digite um texto de ate 30 caracteres: ");
  6. gets(texto);
  7.  
  8. int vogais = 0, i = 0;
  9. for(i = 0; i < sizeof(texto) && texto[i] != '0'; i++){
  10. if(texto[i] == 'a'|| texto[i] == 'e' || texto[i] == 'i' || texto[i] == 'o' || texto[i] == 'u'){
  11. vogais++;
  12. }
  13. if(texto[i] == 'A'|| texto[i] == 'E' || texto[i] == 'I' || texto[i] == 'O' || texto[i] == 'U'){
  14. vogais++;
  15. }
  16. }
  17. printf("Quantidade de vogais: %d", vogais);
  18. return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement