Question: Write a for loop that prints the values 1 2 4 8 16 32 64 by increasing the value of a counting variable by a

Write a for loop that prints the values 1 2 4 8 16 32 64 by increasing the value of a counting variable by a factor of two in each cycle.

Step by Step Solution

3.33 Rating (156 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

int a 1 for int i1 i 10 i Systemoutprintlna if i2 0 a else a loop will decrement t... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Introduction Java Program Questions!