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
Can you have more than one namespace in c#?
Can we make a Static Constructor Parameterized? Give Reason with your answer
Explain About web methods and its various attributes
What is the difference between structure and class in c#?
What is serialization in .net?
What is the purpose of dependency injection?
What is the delegates in c#?
What is console application with example?
What does static mean in c sharp?
Explain About Web.config
What is the and operator in c#?
What is the Signification of the "new " keyword in C#? example
What are namespaces, and how they are used?
Explain the difference between a Private Assembly and a Shared Assembly
What are fields in c#?