Home Segments Index Top Previous Next

180: Practice

Implement an Integer method, powers, that displays the powers of the receiver, from the first to the fifth power, in the transcript, without any unnecessary multiplication. For example, when sent to 2, powers should answer the following:

2 4 8 16 32