The idiomatic way to write that assignment is:
b = (a >= 5) ? 100 : 200;
If you insist on keeping it your way, add parentheses:
(a >= 5) ? (b=100) : (b=200);
For details on why this works in C++ but not in C, see Conditional operator differences between C and C++ (thanks @Grijesh Chauhan!)