Description:
Number format 2 will help you improve the logic for developing patterns.
Learn through my videos:

Program:
package com.telusko.codess;

public class NumberFormat {

	public static void main(String[] args){
		
		
		
		for(int i=1;i<=4;i++){
			
			for(int k=3;k>=i;k--){
				System.out.print("  ");
			}
			for(int j=1;j<=i;j++){
				System.out.print( j+ " ");
			}
			  System.out.println("");
		}
	}
Output:
      1 
    1 2 
  1 2 3 
1 2 3 4 
Logic:
The above code makes use of nested for loop to display the pattern