0
Why in if statements, the code inside the block should be indented?
I mean, what is indented mean here in a block?
4 Answers
+ 2
For Example:
In C++ Language we use if statement with curly bracket
(open & close)
code:
if (a>2)
{
cout<<"c is greater"<<endl;
}
In python:
if a>2:
print("c is greater", c)
> in phyton intended means the border of the if statement
> in c++ language the curly bracket
used for the border of the if statement
+ 1
Then how will you identify which part of the code is inside *if* statment and which is not.
+ 1
A code block belonging to a statement, such as if/else, needs to be:
enclosed in quotes
in parentheses
indented
0
A code block belonging to a statement, such as if/else, needs to be:
indented