this code will help u:


In the System.out.print('' "+" "+a[j]); line add spaces according to ur needs.
Note: Pass ur inputs during run time itself.
That is
U need to give space between...