Go to Top

Wednesday, 5 October 2011

Utilities 16 : Print in style

Compile and sit back to enjoy the surprise.

Java Program :

import java.io.*;
class print_smart
{
 static void main()throws IOException
 {
     BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
     int i,j;
     String s;
     System.out.print("Enter a string : ");
     s=br.readLine();
     s=s+"\n\nThank you";
     for(i=2;i<=s.length();i++)
     {
         try{Thread.sleep(300);}
         catch(InterruptedException e)
         {}
         System.out.print("\f"+s.substring(0,i));
        }
    }
}

No comments:

Post a Comment

ShareThis