+ 2
where is the error in this code?
//print alphabets in descending order and without vowels. #include <stdio.h> int main(){ char ch; printf("Alphabets in Decending order.\n"); for(ch='Z';ch>='A';ch--) { if((ch='A')|| (ch='E') || (ch='I') || (ch='O') || (ch ='U')) { printf(" "); } else { printf("%c",ch); } } return 0; }
2 Answers
+ 8
To test an equality, it's the two operators ==. Don't forget :
= to assign a value
== to test an equality
So :
if((ch=='A')||... )
{
}
+ 1
Thanks mate