basics · beginner · ~15 min
Loop accumulation patterns.
Implement long ipow(int base, int exp) for non-negative exp. Iterative multiplication.
long ipow(int base, int exp) { /* TODO */ return 0; }
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.