// ex 1
if(a != 0){
b = 1/a;
}
else{
b = -1;
}
// ex 2
b = (a != 0 ? 1/a : -1);
Ex 1 looks like 6 lines (if you’re counting line breaks). Which could have been written in a single line as an if(...) expr1; else expr2;
Or the equivalent as shown in Ex 2.
P.S. - yes, I know my bracketing style is uncommon.