0
Why do we leave space to write if and else statement
Why can't we write it all under the same row
2 Antworten
+ 3
You are talking about which language. You hadn't mentioned the language name.
if you nesting two are more if statement in python then indentation is mandatory. but in other languages it dosen't required instead of that curly brackets are used {}
0
It's the syntax of that programming language. The syntax is used to provide some kind of structure in the program for the compiler.
But, in Java, you could write your entire program in a single line because the end of the line is indicated with a semicolon.