204k views
2 votes
One form of the IF field is called an If…Then…Else: If a condition is true, then perform an action; else perform a different action.

User Jigish
by
4.8k points

2 Answers

1 vote

Answer:

If results are true follow Then otherwise follow Else

Step-by-step explanation:

If…Then…Else is a programming language statement. It is used for making a comparison. It compares the results with the help of two types of instruction. One is Then instruction and the other is Else instruction.

A statement is tested first. Results are obtained. Then it is seen whether the results are true or not. If Results come out to be true we follow Then otherwise if results are false we follow Else instructions.

User Halley
by
4.1k points
3 votes

The if statement is a decision making statement. It is used to manage the flow of execution of the statements and additionally used to check logically whether the condition is true or false. The If-else statement is essentially two way declaration and usually used in conjunction with condition. It is used to manage the flow of execution and additionally used carry out the logical test and then pick up one of the two feasible moves depending on the logical test. If a condition is true, then perform an action; else perform a different action.

Step-by-step explanation:

The if statement :

If the condition is true, then the true statements are executed. The true statements are may be a single statement or group of statements. If the condition is false then the true statements are not executed, instead of the program skip fast. The condition is given by relational operator like = =. ! =, < =, > =, etc.

Syntax :

if (condition is true)

{

True statements;

}

The if-else statement :

If there is only one statement in the if block or else block, then the braces are optional. But if there is more than one statement the braces are compulsory.

Syntax :

if(condition)

{

True statements;

}

else

{

False statements;

}