GoConqr has a new look! Let us know what you think.

Module 16 of 16 · Media

Return the x number to the power of y, y times!

Kostas Diakogiannis

Return the x number to the power of y, y times!

F-9 Return the x number to the power of y

Write a function that accepts two numbers and validate that their type is number for sure. 

After that the function should print to the console the all the exponential values between 1 and y. 

For example if we have function(3, 5) The function should print 3, 9, 27, 81, 243.

Another example (2, 8) The function prints 2, 4, 8, 16, 32, 64, 128, 256.

Create another function that accepts again two numbers but in this case it prints all the exponential values (y) for every x number from 1 to x.

 

Example:

example(5, 4) Will for numbers from 1 to 5 all the exponential to the power of 4.

ex. 1**1

1**2

1**3

1**4

2**1

2**2

2**3

2**4

3**1

3**2

3**3

3**4

4**1

4**2

4**3

4**4

5**1

5**2

5**3

5**4

 

Instructions

You must submit an attempt for this quiz to progress. You can submit it after the last question.

Go to the chosen module

Feedback

What is it about?

What do you think of the new look?

How do you like it?