Ask Question
7 January, 17:08

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.

+2
Answers (1)
  1. 7 January, 20:17
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers