[text] Hi

Viewer

  1. int x = 8;  // binary: 0000 1000
  2. int y = x >> 2;  // right shift x by 2 positions
  3. // After right shift by 2 positions, y will be 0000 0010 in binary, which is decimal 2
  4. System.out.println(y);  // Output: 
  5.  

Editor

You can edit this paste and save as new:


File Description
  • Hi
  • Paste Code
  • 07 May-2024
  • 209 Bytes
You can Share it: