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 a satellite assembly in c#?
Is class reference type c#?
Is ram a heap?
What is the process of delegation?
How to get the sum of last 3 items in a list using lambda expressions?
explain the three services model commonly know as a three-tier application.
What is dao in c#?
Can a class be protected in c#?
What are satellite assemblies? How will you get the different language strings?
Why do we use static class in c#?
What is array and arraylist?
What is the difference between ref and out parameters in c#?
Why do we need ienumerable in c#?
Explain what are three test cases you should go through in unit testing?
Define thread? Explain about multithreading?