You are viewing a single comment's thread. Return to all comments →
int tempAnswer = a; for (int j = 0; j < n; j++) { if (j == 0){ tempAnswer += a;}
tempAnswer += (int) (Math.pow(2.0, j) * b); //tempAnswer+=a; if(a==0){ System.out.print(tempAnswer + " ");} else{ System.out.print(tempAnswer-a +" ");} } System.out.println();
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 →
int tempAnswer = a; for (int j = 0; j < n; j++) { if (j == 0){ tempAnswer += a;}