# Thread: what will be the output?

1. ## what will be the output?

x=5
y=++x * ++x

what will be the value of y?

2. ## Re: what will be the output?

49 , but i can't understand the logic pls tell

3. ## Re: what will be the output?

43
scanning from left
5+1=6*6+1=7=42+1
43

4. ## Re: what will be the output?

hello, rohit
when i run this code the result is 49 not 43?

5. ## Re: what will be the output?

i am not sure how the compiler works , 43 or 49. please tell sir

6. ## Re: what will be the output?

Originally Posted by mahesh9920
x=5
y=++x * ++x

what will be the value of y?
the o/p of code is
42

7. ## Re: what will be the output?

Originally Posted by mahesh9920
x=5
y=++x * ++x

what will be the value of y?
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;

8. ## Re: what will be the output?

hi!! answer will be 49.bcz firstly++ poerates than *

9. ## Re: what will be the output?

Originally Posted by amar1_001
49 , but i can't understand the logic pls tell
hi amar. answer is 49 bcz firstly ++ operates two times so x becomes 7 and then 7*7=49

10.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•