0% found this document useful (0 votes)
2 views

Using

Uploaded by

mariodelgadoj87
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Using

Uploaded by

mariodelgadoj87
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

#include <iostream>

using namespace std;

int main() {

int acont = 0, econt = 0, icont = 0, ocont = 0, ucont = 0;

int k = 0;

char palabra[120];

cin >> palabra;

while (palabra[k] != '\0') {

switch(palabra[k]) {

case 'a': case 'A': acont++; break;

case 'e': case 'E': econt++; break;

case 'i': case 'I': icont++; break;

case 'o': case 'O': ocont++; break;

case 'u': case 'U': ucont++; break; }

k++; }

cout << "cantidad de veces por vocal :" << endl;

cout << "a: " << acont << endl;

cout << "e: " << econt << endl;

cout << "i: " << icont << endl;

cout << "o: " << ocont << endl;

cout << "u: " << ucont << endl;

cout<<"total vocales: "<< acont + econt + icont + ocont + ucont<<endl;

return 0; }

You might also like