![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
An if statement is a type of conditional control statement. The format of an if statement is:
if (logical-expression) {statements} |
where logical-expression is the condition to be tested, and statements are the lines of code that are to be executed if the condition is met.
Example
if (q != 1) {a = 0; b = 1;} |