0
Can anybody tell me what is wrong in this code
https://sololearn.com/compiler-playground/cGiRWg6B1U5B/?ref=app
2 odpowiedzi
+ 1
else block should indent
if(*pt=='A'||*pt=='E'||*pt=='I'||*pt=='O'||*pt=='U'||*pt=='a'||*pt=='e'||*pt=='i'||*pt=='o'||*pt=='u')
ctrV++;
else
ctrC++;
pt++;
+ 1
also, ctrC, not ctrC-1
printf("Number of vowels :%d\n Number of consonants :%d\n",ctrV,ctrC);
your code counts blank spaces and digits as consonants.It fails at, for example:
t e st123