How to write program for 2,4,8,16....64using java for loop?
Answers
Answered by
1
public class Program
{
public static void main(String[] args) {
for(int i = 1; i <= 100; i *= 2){
System.out.print(i);
System.out.print(",");
}
}
}
Thanks :)
Similar questions
Math,
5 months ago
Physics,
5 months ago
English,
5 months ago
Math,
10 months ago
Hindi,
10 months ago
Social Sciences,
1 year ago
Social Sciences,
1 year ago