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 does dbml mean in texting?
Explain the difference between a Private Assembly and a Shared Assembly
What is desktop application testing?
What is icomparer in c#?
What is the example of predicate?
Name some properties of array.
Is friend a constructor?
What do you know about Translate Accelerator?
What is a hashset c#?
Explain async and await?
How to declares a two-dimensional array in C#?
Can we write class inside a class in c#?
What do you mean by directing?
How do you comment out code in c#?
What is data hiding in c#?