Help please (I dont get it) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Help please (I dont get it)

https://edabit.com/challenge/2QvnWexKoLfcJkSsc public class Program13 { public static int[] ArrayOfMultiples(int num, int length) { int[] hello; for (int i = 1; i <= length; i++) { hello = Convert.ToInt32(Math.Pow(num, i)); } return hello; } } visual studios says: int cant be converted to int[]

1st Jun 2020, 2:25 PM
Michael
1 Answer
+ 1
I'm not sure but see if this works. public class Program { public static int[] ArrayOfMultiples(int num, int length) { int[] hello = new int[length]; int x = 1; for (int i = 0; i < length; i++) { hello[i] = Convert.ToInt32(Math.Pow(num, x)); x++; } return hello; } }
1st Jun 2020, 2:38 PM
Avinesh
Avinesh - avatar