1,2,4,8,16,32,64 . use for loop to generate this number | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 7

1,2,4,8,16,32,64 . use for loop to generate this number

is a question in java i find hard to understand anything about

4th Oct 2017, 3:16 PM
Joe Charlse
Joe Charlse - avatar
4 Answers
+ 6
// if n = 100 (upper limit) int n = 100; for(int i = 1; i <= n; i*=2) { System.out.print(i+" "); }
4th Oct 2017, 3:30 PM
Dev
Dev - avatar
0
God bless u guys!!!!
4th Oct 2017, 6:50 PM
Joe Charlse
Joe Charlse - avatar
0
#include <stdio.h> int main() { for(int i=1; i<=64; i*=2) { printf("%d\t",i); } return 0; }
29th May 2019, 3:01 PM
Harsh Raj
Harsh Raj - avatar
0
1,2,4,8,16,32,64 . use for loop to generate this number
13th Apr 2023, 6:37 AM
Ravi Kumar
Ravi Kumar - avatar