public void A() {
int x;
x = 8;
x *= 4 + 8 / 2;
}
Given the above code, what is the value of "x"?
Answer Posted / m upendra reddy
i t will foloows the rule of BADMAS
THAT'S why first it caliculate ,like first checks is there
any divisions then caliculate and then multiplictations
x=x*4+8/2;
8/2=4;
then
x=x*4+4;
then x=x*4;==>8*4=32;
now
x=32+4;===>x=36
| Is This Answer Correct ? | 2 Yes | 6 No |
Post New Answer View All Answers
What is an argument in c#?
What is multicast delegate explain with example?
What is sorted list in c#?
What is the difference between interface and inheritance in c#?
Can dictionary have duplicate keys c#?
What are the different ways of method can be overloaded?
Can you inherit from multiple classes in c#?
While debugging a C# application can you change the value of a variable?
What is reflection in c#?
Are multiple data types stored in System.Array?
How can I make sure my c# classes will interoperate with other .net languages?
What are the concepts of dispose method?
Is goto statement supported in c#?
Are structs faster than classes?
How can it prevents DLL Hell assembly versioning in .NET?