ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Microsoft Related  >>  C Sharp
 
 


 

 
 Visual Basic interview questions  Visual Basic Interview Questions
 C Sharp interview questions  C Sharp Interview Questions
 ASP.NET interview questions  ASP.NET Interview Questions
 VB.NET interview questions  VB.NET Interview Questions
 COM+ interview questions  COM+ Interview Questions
 ADO.NET interview questions  ADO.NET Interview Questions
 IIS interview questions  IIS Interview Questions
 MTS interview questions  MTS Interview Questions
 Crystal Reports interview questions  Crystal Reports Interview Questions
 BizTalk interview questions  BizTalk Interview Questions
 Dot Net interview questions  Dot Net Interview Questions
 Exchange Server interview questions  Exchange Server Interview Questions
 Microsoft Related AllOther interview questions  Microsoft Related AllOther Interview Questions
Question
public void A() {
 int x;
 x = 8;
 x *= 4 + 8 / 2;
} 
Given the above code, what is the value of "x"?
 Question Submitted By :: Rajesh
I also faced this Question!!     Rank Answer Posted By  
 
  Re: public void A() { int x; x = 8; x *= 4 + 8 / 2; } Given the above code, what is the value of "x"?
Answer
# 1
64.
Although if you place the same thing like:
x = x * 4 + 8 / 2;
this yields 36 which was my first guess.
How come its producing two different results? Aren't the 
assignment statements suppose to get the same result?
 
Is This Answer Correct ?    0 Yes 1 No
Aspdev556
 
  Re: public void A() { int x; x = 8; x *= 4 + 8 / 2; } Given the above code, what is the value of "x"?
Answer
# 2
Sorry for the confusion, figured it out.
x = x * 4 + 8 / 2 only multiplies x by 4 not the whole 
expression.
 
Is This Answer Correct ?    3 Yes 0 No
Aspdev556
 
 
 
  Re: public void A() { int x; x = 8; x *= 4 + 8 / 2; } Given the above code, what is the value of "x"?
Answer
# 3
x*=4+8/2 =====> x=x*(4+8/2)
This is correct and the answer is 64
 
Is This Answer Correct ?    2 Yes 2 No
Chandusrit
 
  Re: public void A() { int x; x = 8; x *= 4 + 8 / 2; } Given the above code, what is the value of "x"?
Answer
# 4
answer is 64
 
Is This Answer Correct ?    2 Yes 2 No
Prasad
 
  Re: public void A() { int x; x = 8; x *= 4 + 8 / 2; } Given the above code, what is the value of "x"?
Answer
# 5
x=8;
x=12/2*8;
x=6*8;
x=48;

The Anwere is 48
 
Is This Answer Correct ?    0 Yes 3 No
Nitin
 

 
 
 
Other C Sharp Interview Questions
 
  Question Asked @ Answers
 
What?s different about switch statements in C#?  2
How do you generate documentation from the C# file commented properly with a command-line compiler?  1
How can you sort the elements of the array in descending order? Junosource1
what is the difference between interface and abstraction? Choice-Solutions3
What?s the implicit name of the parameter that gets passed into the class? set method? Visual-Soft2
What?s the C# equivalent of C++ catch (?), which was a catch-all statement for any possible exception?  1
What is the Difference between value and reference type? Wipro5
Can you inherit multiple interfaces? Mind-Tree3
In Main function another function is there and to that function if we pass string as parameter ,then that string value is passed by value or reference type? Honeywell3
Can multiple catch blocks be executed?  1
What r collections c sharp?  2
ThreadStart is defined in the namespace System.Threading. What type of entity is ThreadStart?  1
What?s the difference between the Debug class and Trace class?  1
What are STA And MTA in threading? Kanbay2
What is the Difference between directcast and ctype? Wipro1
What are strin concatation methods in c#? Phoenix-Technologies1
Describe the accessibility modifier protected internal. Visual-Soft1
What is stack and heap? Wipro4
What does assemblyinfo.cs consists ? Microsoft2
What happens in synchronisation? Tech-Mahindra2
 
For more C Sharp Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com