+ 1

Given x and y as input. Print all the power of x from 1 to y.

test case: input x=17,y=3, output : 17#289#4913#

17th Feb 2018, 2:00 PM
Roshan Kumar
Roshan Kumar - avatar
1 Odpowiedź
+ 1
javascript (es6) let x = 17, y = 3; document.write(Array.from({'length':y}, (_,i) => x**(i+1)).join('<br>'));
17th Feb 2018, 2:43 PM
Schindlabua
Schindlabua - avatar