← Unit 1 · all exercises
Saved in this browser only

Double it twice

Take the number, double it, then double it again, and return the result. Use *= both times.

int quadruple(int n)

Solution.java
Loading editor…
Results

Examples

  • quadruple(3) → 12
  • quadruple(1) → 4

There are also 3 hidden tests you can't see. Solve the problem, not the examples.