<Is it possible to add two numbers whose power is ...
# stackoverflow
u
Is it possible to add two numbers whose power is the iterator in for loop in Kotlin without using power function Programming Language: KOTLIN I'm trying to make a function which adds two numbers in the following way.. a^i+b^i where "i" would be the iterator in for loop. So I want the i to range from 1 to 10 and print the result one by one like this... for example if I give the values as a=1 & b=2 then the result must be calculated as.. a^1+b^1= 1^1+2^1 which gives 3 so print the result. a^2+b^2= 1^2+2^2 which gives 6 and print the result. etc., repeating the process until i becomes 10. so I tried the...