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
What is iqueryable?
What is callback in c#?
List the differences between method overriding and method overloading?
Where do we set the min and max pool size for connection pooling?
Explain About web methods and its various attributes
How do I format in c#?
What is serialization in dot net?
What is a linked list c#?
When should I throw an exception?
Can enum have methods c#?
Can you use all access modifiers for all types?
What does out mean c#?
What is a verbatim string literal and why do we use it?
What are winforms in c#?
What are jump statements in c#?