Right Shift in C

Level 124 keystrokes

Shifts the bits of 20 two positions to the right.

C code

// >> is the right shift operator
// 20 >> 2 shifts bits right by 2, equivalent to 20 / 4 = 5
1printf("%d\n", 20 >> 2);

Output

5
Practice typing this code

Practice typing this code. Results are not recorded in the rankings.

Symbols in this code

The symbols you type in this C code and how often they appear.

  • "× 2
  • >× 2
  • ,× 1
  • ;× 1
  • (× 1
  • )× 1
  • \× 1
  • %× 1

More C examples at level 1

← C typing practice