explain if state ments with syntax
Answers
Answered by
2
Syntax of if statement:
The statements inside the body of “if” only execute if the given condition returns true. If the condition returns false then the statements inside “if” are skipped.
The statements inside the body of “if” only execute if the given condition returns true. If the condition returns false then the statements inside “if” are skipped.
Answered by
1
If <condition met> do the following task
... ... ...
Else if <condition met> do the following task
... ... ...
Endif
The above syntax which is normally stands same in most of the computer languages. To explain in simple the If statement is a condition executioner in a given program when executed has some detailed set of instructions to follow/execute.
While the Else if is the option takes the command of executing the set of commands/instructions written after this statement.
Wherein the Endif statement is the command which terminates the If statement execution in the program.
... ... ...
Else if <condition met> do the following task
... ... ...
Endif
The above syntax which is normally stands same in most of the computer languages. To explain in simple the If statement is a condition executioner in a given program when executed has some detailed set of instructions to follow/execute.
While the Else if is the option takes the command of executing the set of commands/instructions written after this statement.
Wherein the Endif statement is the command which terminates the If statement execution in the program.
Similar questions