ExamVeda
Login
Home
Operators and Expressions
?

Given b=110 and c=20, what is the value of 'a' after execution of the expression a=b-=c*=5?

Answer & Solution
Correct Answer: Option B

As the expression is evaluated from right to left.

Examveda
Question posted by Examveda
Community

Join the Discussion

2 Comments
Sanath Kumar
Sanath Kumar 9 years ago
= is the assignment operator and evaluates from right to left
c = c*5 =100
b = b-c =110-100 =10
a =b =10
Eth Enock
Eth Enock 10 years ago
yes c*5=20*5=100 and the question now becomes a=b-=c=100;
b=b-c=110-100=10 and the question now becomes a=b=10;

the answer to this question starts by evaluating from right to left.