GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Microsoft  >  C#
Go To First  |  Previous Question  |  Next Question 
 C#  |  Question 403 of 436    Print  
Value of x
This is interview question,

public void A()
{
int x;
x = 8;
x *= 4 + 8 / 2;
}
Given the above code, what is the value of "x"?

options:- A) 3
B) 2
C)4
D) None



  
Total Answers and Comments: 7 Last Update: May 30, 2008     Asked by: nithya R 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
January 27, 2008 18:42:49   #1  
nikhilbandodkar Member Since: January 2008   Contribution: 2    

RE: Value of x
The answer is 64
 
Is this answer useful? Yes | No
January 28, 2008 08:45:14   #2  
nithya R Member Since: December 2007   Contribution: 7    

RE: Value of x
Can u explain how you get 64 ?
 
Is this answer useful? Yes | No
January 28, 2008 09:37:51   #3  
studentmca2007 Member Since: March 2007   Contribution: 1    

RE: Value of x
The answer is '64'


 
Is this answer useful? Yes | No
January 28, 2008 10:47:35   #4  
nikhilbandodkar Member Since: January 2008   Contribution: 2    

RE: Value of x
x * 4 + 8/2 is equivalent to x x * (4 + 8/2)

This equates to x x * (4 + 4) /* the division operation is carried out prior to the addition operation */

Which is nothing but x 8 * 8 > 64

 
Is this answer useful? Yes | No
February 04, 2008 01:49:48   #5  
pritam83 Member Since: September 2007   Contribution: 5    

RE: Value of x
The Answer is 64
 
Is this answer useful? Yes | No
May 07, 2008 04:45:42   #6  
ushalakshmi Member Since: April 2008   Contribution: 40    

RE: Value of x
Value of X is 64
 
Is this answer useful? Yes | No
May 30, 2008 07:05:49   #7  
abha2584 Member Since: May 2008   Contribution: 1    

RE: Value of x
Answer is 64
 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape