Computer-Networks
November 15, 2023
Question 11269 – Data-Type
November 15, 2023
Computer-Networks
November 15, 2023
Question 11269 – Data-Type
November 15, 2023

Question 11630 – Data-Type

Consider the following set of statements?

       Float x, y : 
       x=7;y=10:
       x*=y*=y*28.5 : 

After the execution of the above set of statements, the value of x will be

Correct Answer: D

Question 1 Explanation: 
Arithmetic operator has the higher precedence so y*28.5 will be calculated first which will give 10*28.5=285.

So now the statement will become x*=y*=285;
The assignment operator has right to left associativity. So now,
x*=(y=y*285)
x*=(y=10*285)
x*=(y=2850)
x=x*2850
x=7*2850
x=19950
A
70
B
2695
C
2995
D
None of these
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!