+ 1
Is it possible to leave out curly braces in the else statement as well if only one line of code is supposed to be executed?
9 Respuestas
+ 6
Yes.. By default the scope of if and else is line next to it so for a single line execution you can leave out the curly braces.
+ 1
Yup
+ 1
you can...but don't leave the curly braces,just always makes the habit of putting curly braces in these types of statement. it won't alter your program👍
+ 1
yes
0
yes
0
That's right.
0
yes
0
Yup! But if your sharing the program, curly braces are usually easier to read. :)
0
that right way