Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / vinodh kumar

operator precedence...
* / % + -

x = x * 4 + 8 / 2;

(i) x*(4+(8/2))
(ii) x*(4+4)
(iii) x*8 => Replace x with 8 as per question :P
Ans:64

http://www.blackwasp.co.uk/CSharpOperatorPrecedence.aspx

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are delegates?

1236


Define an abstract class?

923


What is the main method?

940


If multiple interfaces are inherited and they have conflicting method names; What will happen ?

963


What can be done with c#?

833


What is dll in vb.net?

942


What do you understand by an Implicit Variable?

1016


Is the following code legal?

976


What is difference between singleton and static class in c#?

952


Is c# good for beginners?

898


Explain how obfuscator works in .net

1004


What are value types in c#?

903


Where do I put dll files?

1012


What are the types of serialization?

968


What are object pooling and connection pooling and difference? Where do we set the Min and Max Pool size for connection pooling?

1150