Description:
Solving this problem will help you improve logic.
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 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 uses nested for loop and for loop in it to display the particular pattern