Win a copy of Kubernetes in Action this week in the Cloud/Virtualization 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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!