Bit operation. | Sololearn: Learn to code for FREE!

0

Bit operation.

What does b/a?a:b mean? Where a and b are integers.

c++ c

12/2/2019 9:56:05 AM

Pir-CHILD

2 Answers

New Answer

+3

That is called a ternary operator. If b/a is greater than 0 than it will assign the value of "a" to the variable or if b/a is 0 then it will assign the value of "b" to the variable. It is a simple if else statement.

+2

This is not bit operation. It is ternary operator syntax with (IF Condition is true) ? (Do this) : (Else Do this);