Conditional statements help you to make a decision based on certain conditions . These conditions are specified by a set of conditional statements having boolean expressions which are evaluated to a boolean value true or false.
Read moreWhat is conditional statement explain with example?
A statement that is of the form “If p, then q” is a conditional statement. Here ‘p’ refers to ‘hypothesis’ and ‘q’ refers to ‘conclusion’. For example, “If Cliff is thirsty, then she drinks water.” This is a conditional statement.
Read moreWhat are examples of ternary operator?
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); This example takes more than 10 lines, but that isn’t necessary.
Read more