The exercise asks to, from a vector with a phrase, show its content in gibberish (it has to go through the arrangement, when it finds a vowel, it adds p + vocal example: hidden: e eg sco po ndi pi do po). I did it with a switch, but it's not working for me. Also, I would have to load it into an M x N matrix. The code I made is the following:
#include<stdio.h>
char jerigonza (char frase[], int n){
//lee frase y la guarda en el arreglo frase
for (int i=0; i<n;i++){
printf ("Escriba una frase:\n");
scanf ("%s", frase);
}
//busca vocales y le agrega p+vocal
for (int j=0; j<n; j++){
switch (frase[j]){
case 'A': case 'a': printf ("pa");
break;
case 'E': case 'e': printf ("pe");
break;
case 'I': case 'i': printf ("pi");
break;
case 'O': case 'o': printf ("po");
break;
case 'U': case 'u': printf ("pu");
break;
default: return 0;
break;
}
}
}
int main(){
char a[50];
jerigonza (a,50);
return 0;
}