When do you use an else statement?
To Input a variable
To tell what will happen when an if-statement is false.
To end an IF statement.
To handle string values

Respuesta :

Answer:

To tell what will happen when an if-statement is false

Explanation:

We use else statement if if-statement get false.

for example

if(a>20)

{

print "your age is greater than 20"

}

else

{

print "Your age is less than 20"

}

In the pseudo code, you see the use of else statement, that if age is greater than 20 then display message "you are age is greater than 20". if this statement get false, i.e. you are age is not greater than 20 then else statement will be executed and message will be displayed that your age is less than 20.

Why other option are not correct

To input a variable:

to get input, we use input statement of respective programming language not if-else statement.

To end an if statement

we don't use else statement to end if statement. when condition met then if statement will be ended

To handle string value

we use input validation statement to handle if statement.