+ 1
Hey guys can some help me with loops in java
i need to print this 1.000000000 2.000000000 4.000000000 8.000000000 16.000000000 32.000000000 64.000000000 128.000000000
2 Réponses
+ 11
run a loop for 8 times & by seeing pattern its ×2 series
//here is a simple code
int j=1;
for(int i=1;i<=8,i++){
System.out.println(j);
j=j*2;
}
0
Loop from 1 to 128
For the increment part dont use i++, find a relatiom between those numbers and how it increase.
Inside create another loop from 1to 8 then print 0