Hi all,
I'm running a program that replaces all the vowels of a given sentence to another given vowel. The issue is that it works for all the vowels except when it has to replace the vowel "A".
The program is
Code:
#include<stdio.h>
int main(void){
char sentence[200], vowel[6]="aeiou", changeVowel;
int i, j;
printf("Introduce a sentence (max 200 characters)\n");
scanf("%[^\n]s", sentence);
printf("Introduce a vowel\n");
scanf("%s", &changeVowel);
for(i=0; sentence[i]!='\0'; i++){
for(j=0; j<6; j++){
if(sentence[i]==vowel[j]){
sentence[i]=changeVowel;
}
}
}
printf("%s\n", sentence);
return 0;
}
As you can see,the A is not switched:
Do you know what is going on?
Thanks!
Sergi