not really in C (battery=charged) is not a comparison it's an assignment ,while the statement will compile in C the results will be incorrectAh, what I posted should compile in C or PBP, and in both languages inner brackets should evaluate first, and in order toward outer brackets.
C
if (battery=charged) && (lightbulb != blown) { ‘ AND bulb will light }
(battery==charged) is a comparison statement in C
Bookmarks