Anyone please explain this???

9 replies
Here is a series of three steps:

Step 1: A = 10
Step 2: B = 20
Step 3: A = B

A and B are variables, that is they can stand for any value.
The "=" sign stands for assignment. It means "assign the value on the right to the variable on the left".
After all three steps above have been completed, what are the values of A and B? *
A = 30, B = 0
A = 30, B = 20
A = 20, B = 20
A = 20, B = 0
A = 10, B = 10
A = 10, B = 20
A = 20, B = 10
A = 0, B = 10
#explain
Avatar of Unregistered
  • A=20
    B=20

    The variables will be equal to the last number assigned to them.
    {{ DiscussionBoard.errors[10218067].message }}
  • Profile picture of the author David Beroff
    So where do you go to school?
    Signature
    Put MY voice on YOUR video: AwesomeAmericanAudio.com
    {{ DiscussionBoard.errors[10218604].message }}
    • Profile picture of the author KirkMcD
      Originally Posted by David Beroff View Post

      So where do you go to school?
      If he couldn't figure that out, I don't think he does go to school.
      {{ DiscussionBoard.errors[10219250].message }}
      • Profile picture of the author David Beroff
        Originally Posted by KirkMcD View Post

        If he couldn't figure that out, I don't think he does go to school.
        Maybe I was being too subtle. I was trying to imply that he was asking us to do his homework for him.
        Signature
        Put MY voice on YOUR video: AwesomeAmericanAudio.com
        {{ DiscussionBoard.errors[10219280].message }}
  • Profile picture of the author KirkMcD
    I think I was a bit more subtle than you, in that I pretty much just called him (and I'm going to be subtle again) not very smart.
    {{ DiscussionBoard.errors[10219577].message }}
  • Profile picture of the author PriyaJayaraman
    Answer is 3rd Option from the given above list. B is getting assigned to A, since assignment operator is used.
    {{ DiscussionBoard.errors[10227016].message }}
    • Profile picture of the author smilesumo
      A = 30, B = 0 <-- i am pretty sure this would return a syntax error
      {{ DiscussionBoard.errors[10235860].message }}
  • Profile picture of the author yaser3bed
    Step 3 made the variable constant
    A = 10, B = 20 that is right
    yaser abu sh
    {{ DiscussionBoard.errors[11305936].message }}
  • Profile picture of the author ruchi chouhan
    A=20 and B=20
    {{ DiscussionBoard.errors[11307316].message }}
Avatar of Unregistered

Trending Topics