Originally posted by Alpana Singh:
But a in int,How can we assign a boolean value to int.
As I responded to your duplicate post...
The syntax a = b? c: d; means
if b, then
a = c; else
a = d. There is no assignment of b (the boolean) to a.
Here, because x is false, the line a = x? 3: 4; assigns a = 4.