188k views
4 votes
I need somebody’s help rq

What's the output of the pseudo code below?
x=7
x = x + (x mod 5)
×=x*x
display(x)
O64
O81
O8
O7

1 Answer

3 votes

In the first step, we create an integer variable and assign it the value
7.

In the second step, we modify the current value of
x by mod
5. The concept of mod refers to the remainder of the quotient. Since the remainder when we divide
7 by
5 is
2, the expression in parentheses will be
2.

Then we made
7+2=9 and updated the current value of our variable.

In the third step, we squared our variable
x and updated the value of our variable again with the result.
9*9=81 and printed the value
81 on the terminal.

The correct option should be the second one.

User JKLM
by
6.0k points