public void A() {
int x;
x = 8;
x *= 4 + 8 / 2;
}
Given the above code, what is the value of "x"?
Answer Posted / aspdev556
64.
Although if you place the same thing like:
x = x * 4 + 8 / 2;
this yields 36 which was my first guess.
How come its producing two different results? Aren't the
assignment statements suppose to get the same result?
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
Explain what a diffgram, and a good use for one Define diffgram? How it be used?
Explain the role of Garbage collector and its generations?
Why do we need structs in c#?
What is a copy constructor in c#?
Define a class and an object?
What is difference between gridview and form view?
Can we have multiple threads in one app domain?
What is the default scope of a class in c#?
What is the default value of object in c#?
What is the syntax for calling an overloaded constructor within a constructor?
What is tryparse c#?
What is Custom attribute? How to create? If I'm having custom attribute in an assembly, how to say that name in the code?
What is .cs file in c#?
What is the difference between CreateObject() and GetObject()?
What is a generic in c#?