difference between two expression given below

0 votes
asked Sep 3 by operator
assume x=5,y=5;

x*=3+5;

y=y*3+5;

6 Answers

+1 vote
answered Sep 3 by anonymous
x*=3+5 will become x=x*(3+5) which will be x*8 = 40

where y=y*3+5 will be solved by BODMAS = 20
commented 4 days ago by (110 points)
distint and clear
0 votes
answered Sep 3 by remember me
for first expression is short end it can also written as x=x*(3+5)

for second it is multiplication  of   var y with 3 and then adding it to 5
+1 vote
answered Sep 3 by anonymous
Using order of Operator Precedence

x*=3+5        //x=5*(3+5)

y=y*3+5      //y=y*3+5

Answers = 40, 20
0 votes
answered 6 days ago by (140 points)
both are same
0 votes
answered 4 days ago by anonymous
first one is x= x*(3+8);//x*=3+5 *= is compound operator

second one is y = y*3+5
0 votes
answered 4 days ago by (180 points)
x*=3+5;      ==>    x = x*(3+5)    ==>   40

y=y*3+5;   ==>    y = (y*3)+5    ==>  20

Now you can see the exact difference.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...