I always get errors in c programming while using if and else as " expected expression before else". Why do this error display?

Recommended Answers

All 2 Replies

Hi raj208851 welcome here at daniweb!
Well your compile tells you what is wrong, it expected an expression before the else keyword. If you would send in some example code that would help us tremendously.

Just a side note. Often time, the error comes when the code has improperly closing scope (the curly bracket). However, another error comes when there is no if statement but only else statement. Whever it is, you would need to show your code portion (and I hope it is not a big long code). :P

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.