We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
(answer for ur question is if consider a =10 , that line prints a blank space for the value i.e., 10)
import java.util.;
import java.io.;
class Solution{
public static void main(String []argh){
Scanner in = new Scanner(System.in);
int t=in.nextInt();
for(int i=0;i<t;i++){
int k =0;
int r=0;
int a = in.nextInt();
int b = in.nextInt();
int n = in.nextInt();
// System.out.println(a+" "+b+" "+n );
for (double j =0;j<n;j++){
r = r+(int)(Math.pow(2.0,j)*b);
k=r+a;
System.out.print(k+" ");
}
System.out.print("\n");
}
in.close();
}
}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Join us
Create a HackerRank account
Be part of a 26 million-strong community of developers
Please signup or login in order to view this challenge
Java Loops II
You are viewing a single comment's thread. Return to all comments →
(answer for ur question is if consider a =10 , that line prints a blank space for the value i.e., 10) import java.util.; import java.io.;
class Solution{ public static void main(String []argh){ Scanner in = new Scanner(System.in); int t=in.nextInt();
}