Give the value of each of the following expressions in the s

Give the value of each of the following expressions in the specified, language. If the expression is illegal, give \"illegal\" as your answer. If the value of an expression is undefined, give \"undefined\" as your answer. Ada: 2 ** 4 Java: --i !=J++ ? i--: ++j Assume that i is 4 and j is 3 before the expression is evaluated. C i-- || ++j ? j: 1 Assume that i is 2 and j is 5 before the expression is evaluated. C: i/--i Assume that i is 2 before the expression is evaluated. C++: d = (i= 4.5) + l Assume that i is an int variable and d is a double variable. Ada: 8 rem (abs (4 - 7)) Java: i = j + k Assume that i, i, and k arc short variables and that j is 3 and k is 7. APL: 24 + 30 - 6 x 3

Solution

a) Vaid . It produce the value equal to 16.(i.e -2 power of 4)

b)Valid . It produce the value equal to 5

c)Valid . It produce the value equal to 5

d)Valid . It produce the value equal to 1

e)Valid.It produce the value equal to 5(note : assume i,d declaration already done)

f)Valid.It produces value 2.

g)Valid . It produce the value equal to 10

h)Valid .It is simply arthimetic expression.

 Give the value of each of the following expressions in the specified, language. If the expression is illegal, give \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site