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.
System.out.println("================================");inttotalLength=15;for(inti=0;i<3;i++){Strings1=sc.next();intx=sc.nextInt();//Complete this lineStringformatnumber=String.format("%03d",x);intspaceNeeded=totalLength-s1.length();StringBuilderspaces=newStringBuilder();for(intj=0;j<spaceNeeded;j++){spaces.append(" ");}StringfinalString=s1+spaces+formatnumber;
Java Output Formatting
You are viewing a single comment's thread. Return to all comments →
undefined System.out.println(finalString); } System.out.println("=========== `=====================");