- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJava_Loops_II.java
More file actions
Latest commit
26 lines (23 loc) · 724 Bytes
/
Copy pathJava_Loops_II.java
File metadata and controls
26 lines (23 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
importjava.util.*;
importjava.io.*;
classJava_Loops_II{
publicstaticvoidmain(String []argh){
Scannerin = newScanner(System.in);
intt=in.nextInt();
for(inti=0;i<t;i++){
inta = in.nextInt();
intb = in.nextInt();
intn = in.nextInt();
intsum = a;
for (intj = 0; j<n; j++) {
intnextEle = (int)Math.pow(2, j)*b;
sum = sum + nextEle;
System.out.printf("%s ",sum);
}
if (i < t-1) {
System.out.print("\n");
}
}
in.close();
}
}