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 are delegates?
Define an abstract class?
What is the main method?
If multiple interfaces are inherited and they have conflicting method names; What will happen ?
What can be done with c#?
What is dll in vb.net?
What do you understand by an Implicit Variable?
Is the following code legal?
What is difference between singleton and static class in c#?
Is c# good for beginners?
Explain how obfuscator works in .net
What are value types in c#?
Where do I put dll files?
What are the types of serialization?
What are object pooling and connection pooling and difference? Where do we set the Min and Max Pool size for connection pooling?