Write syntax of ternary operator and give an example.
Please help me
Answers
Answered by
0
It helps to think of the ternary operator as a shorthand way or writing an if-else statement. Here's a simple decision-making example using if and else: int a = 10, b = 20, c; if (a < b) { c = a; } else { c = b; } printf("%d", c)
Answered by
1
Similar questions