Ask Question
15 July, 10:20

What is the output of code corresponding to the following program segment if?

If Age > = 18 Then

Write "You are eligible to vote."

Else

Set - Age

Write "You can vote in " + Years + " years."

End If

a. You are eligible to vote.

b. You can vote in 18 years.

c. You are not eligible to vote.

d. You cannot vote in 0 years.

+5
Answers (1)
  1. 15 July, 12:13
    0
    a. You are eligible to vote.

    Explanation:

    If Age > = 18 Then

    Write "You are eligible to vote."

    Else

    Set - Age

    Write "You can vote in " + Years + " years."

    End If

    The above code block is an example of if-else code block. The if-else code block follow a pattern of:

    If (expression) then

    else

    (expression)

    end if

    Based on the if Age> = 18 condition, the output will be "You are eligible to vote."
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “What is the output of code corresponding to the following program segment if? If Age > = 18 Then Write "You are eligible to vote." Else Set ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers