asked 48.8k views
1 vote
The parentheses around the logical expression of an if statement are optional.

a) True
b) False

1 Answer

0 votes

Final answer:

The parentheses around the logical expression of an if statement are optional.

Step-by-step explanation:

The correct answer is a) True.

The parentheses around the logical expression of an if statement are indeed optional in programming languages such as C, C++, Java, and Python.

For example, in Java, the if statement can be written with or without parentheses:

  • With parentheses: if (condition) { // code }
  • Without parentheses: if condition { // code }
answered
User Harry He
by
7.8k points

No related questions found