Hi
i'm new to the programming world
i need a java code for following problem
i have an input like
the desired output is
How can i do that ?
Thanks in advance
---------- Post updated at 12:51 PM ---------- Previous update was at 12:07 PM ----------
import java.lang.String;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author vaibhav
*/
public class tmep {
private static String str;
public static void main(String args[])
{
str="123456789";
for(int lim=0;lim<9;lim++)
{
for(int start=1;start<=(9-lim);start++)
{
for(int i=start;i<=lim+start;i++)
{
System.out.print(str.charAt(i-1));
}
System.out.print("\t");
}
System.out.println("");
}
}
}