GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Modul 16 von 16 · Medien

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

 

Anleitung

Um im Kurs weiterzukommen, sende einen Versuch dieses Quiz ab. Du kannst ihn nach der letzten Frage absenden.

Zum gewählten Modul

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck