Please tell me why do i get this error saying "error C2181: illegal else without matching if". The last else statement doesn't work. There is a red line under the else. Can some plz tell me the solution. I hv been trying since hours. Please do not worry about variables.
because use used {} to contain your if elses, it read as a block. now you have entered the else right after line 23, now according to the compiler you put an "else" with out an "if". what you should do is remove the {}.
I'm not exactly sure what the purpose of your program is, but I do know two things.
1. You have worthless brackets on lines 13 and 23.
2. Indivilual comparisons need to be enclosed in parenthesis like this if ((c >= 1) && (c < 20))