How to make a program to print the series : 1,12,123...12345678910,1234567891011...& so on to the nth term in java(Bluej)? :    //I tried this one but output was wrong for tenth term
     import java.io.*;
     public class series
     {
     public static void main(String args[])throws IOException
     {
     BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
     int n,i,i1=0,s=0,c=0;
     System.out.println("Enter the term of the series you want to get");
     n=Integer.parseInt(in.readLine());
     for (i=1;i<=n;i++)
     {
     i1=i;
     while (i1!=0)
     {
     c+=1;
     i1=i1/10;
     }
     s=(int)(s*(Math.pow(10,c))+i);
     c=0;
     System.out.print(s+" ");
     }
     }
     }
