public void A() {
int x;
x = 8;
x *= 4 + 8 / 2;
}
Given the above code, what is the value of "x"?
Answer Posted / vinodh kumar
operator precedence...
* / % + -
x = x * 4 + 8 / 2;
(i) x*(4+(8/2))
(ii) x*(4+4)
(iii) x*8 => Replace x with 8 as per question :P
Ans:64
http://www.blackwasp.co.uk/CSharpOperatorPrecedence.aspx
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
Difference between Value type & reference types ? and give the example in .Net?
What is xml serialization and deserialization in c#?
What is generic and non generic collections in c#?
Can we inherit sealed class in c#?
What is int32 maxvalue?
how can one use hcl and c sharp together?
What is the signature of a method?
What is an ienumerable in c#?
What is yield keyword?
What does assert() do in c#?
What is the difference between static and constant variables?
You are creating a custom usercontrol, some of the newly created properties are shown in the properties window. How you can hide a new property named theme from the properties window?
Why do canadians say zed?
What are the Uses of CLR
Should I make my destructor virtual?