SHL
Choose the correct option.
What will be the output of the following pseudocode statements?
(Note: Assume that when two data types are processed through an operator, the answer maintains
the same data type as that of the input. Also, all data types have enough range to accommodate any
number. If two different data types are operated upon the result assumes the data type that is more
expressive.)
integer a = 456. b, c d =10
b = ald
c-a-b
print
Answers
Answered by
5
Answer:
The output printed is 411.
Explanation:
The given pseudocode statement can be solved using basic arithmetic calculations. The statement has provided us with the integral values of variables a, b, c, d. The expression to be printed by the computer is given by b=a/dc=a-b. The first part says a/dc i.e 456/10 which is equal to 45.6. Now the real question arises whether to consider the value of the expression as 45 or 45.6? Now as the values are given as integral values we consider only the integral part and neglect the decimal part.
The second part of the question says a/dc = a-b. On substitution of values we get,
a=456,b=45
Expression is a-b and we get the answer as 456–45=411.
Hence the output printed is 411.
Similar questions