Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.


+20 votes

Is there any certain reason to why in an if/else if/else statement the if begins with a ( , the else if begins with ( , and the else begins with { ?

asked in CSC211_Winter2018 by (1 point)

1 Answer

+14 votes

Well the parenthesis indicate that there is a condition for the if and the else if statements to run, but the condition for the else statement is inherent in that the else statement runs if the conditions for any previous if/ else if statements were not met, so there is no need for parenthesis to specify a condition.

answered by (1 point)