You are viewing a single comment's thread. Return to all comments →
Thanks vinityadav !! it works! private static String answer(int a, int b, int n){ String answer = ""; int tempAnswer= a; for (int i = 0; i < n; i++) { tempAnswer += (int) (Math.pow(2.0, i) * b); respuesta = respuesta+ " " + tempAnswer; }
Seems like cookies are disabled on this browser, please enable them to open this website
Java Loops II
You are viewing a single comment's thread. Return to all comments →
Thanks vinityadav !! it works! private static String answer(int a, int b, int n){ String answer = ""; int tempAnswer= a; for (int i = 0; i < n; i++) { tempAnswer += (int) (Math.pow(2.0, i) * b); respuesta = respuesta+ " " + tempAnswer; }