x=5
y=++x * ++x
what will be the value of y?
Printable View
x=5
y=++x * ++x
what will be the value of y?
49 , but i can't understand the logic pls tell
43
scanning from left
5+1=6*6+1=7=42+1
43
hello, rohit
when i run this code the result is 49 not 43?
i am not sure how the compiler works , 43 or 49. please tell sir
[QUOTE=mahesh9920;20005]x=5
y=++x * ++x
what will be the value of y?[/QUOTE]
the o/p of code is
42
[QUOTE=mahesh9920;20005]x=5
y=++x * ++x
what will be the value of y?[/QUOTE]
the value is assigined only in left side
a=5;
b= 7*7;
b=49
b=++a*++a;
*(7);
(7)
b=7*7;
b=49;
hi!! answer will be 49.bcz firstly++ poerates than *
[QUOTE=amar1_001;20073]49 , but i can't understand the logic pls tell[/QUOTE]
hi amar. answer is 49 bcz firstly ++ operates two times so x becomes 7 and then 7*7=49