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
Why use a singleton instead of static methods?
What does void do in unity?
What are the benefits of using the aggregate method in linq?
What is parse method in c#?
How will you deploy the dll file in gac?
Define a jagged array in c#?
What are c# types?
Hi Friends, I am going through Siemens Interview Procedure from last 1+1/2 months. I went through 1 written + 2 Technical + 1 Managerial Round process after which I got call from HR informing that "you are selected and we would like to meet you for HR round". HR round was very nominal compared to MR. HR Round last for hardly 5 mins. They told me that you will get the final result on Friday. Still I have not received any feedback from them. Please help!!!
Is it not possible to store a boolean value as a variable?
What is the use of delegate?
Explain anonymous type in c#?
How many bytes is a char c#?
What is system console writeline in c#?
What is the difference between internal and protected in c#?
What is the difference between class and namespace?