Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

operators  RSS feed

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
This is from sun Ed services sample Que's
Which two are equivalent? (Choose two.)
12>4
12/4
12*4
12>>2
12/2^2
12>>>1
Answer is given that 12/4 and 12>>2 are equivalent. Can anybody explain.
 
Ranch Hand
Posts: 1070
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do the math and see if you can figure it out. It is basically saying that the result will be the same.
Bill
 
Ranch Hand
Posts: 439
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in my opinion its 12/4 and 12>>2
because 12 / 4 produces 3 and
12 is 00001100 and when shift produces
00000011
so the result of it is 3 they both produce same result
 
madhuri vl
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi bill and val,
Thank you very much.
 
Eliminate 95% of the weeds in your lawn by mowing 3 inches or higher. Then plant tiny ads:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!