printf("%d", 10 ? 0 ? 5:1:1:12) what will print

The code printf("%d", 10 ? 0 ? 5:1:1:12) will print the value 1. Here's an explanation of each step:

  1. The expression 10 ? 0 ? 5:1:1:12 is evaluated.
  2. The ternary operator ? : is used to evaluate the expression. It takes three operands: the condition, the value if the condition is true, and the value if the condition is false.
  3. In this case, the condition is 10, which is considered true because it is non-zero.
  4. The first operand after the condition is 0 ? 5:1:1:12. Since the condition is false (0), the value 1 is chosen as the result of this operand.
  5. Therefore, the overall expression evaluates to 1.
  6. The printf function is used to print the value 1 using the format specifier %d.

So, the output of the code will be 1.