Sunday 11 November 2018

HackerRank Java Loops II Solution


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 a = in.nextInt();
            int b = in.nextInt();
            int n = in.nextInt();
            int d[]=new int[n];
            int res=0;
            int c=1;
            for(int j=1;j<=n;j++)
            {
                if(j==1){
                res= a +b*c;
                }
                else
                {
                    res= res+b*c;
                }
                c=c*2;
                d[j-1]=res;
            }
            for(int z=0;z<d.length;z++)//length is the property of array 
            {System.out.print(d[z]+" ");  }
            System.out.println("");
                }
           
       
        }

    }

Error While embed the video in Your website page

Error:- Refused to display '<URL>' in a frame because it set 'X-Frame-Options' to 'sameorigin Solution:- if ...