Wednesday, January 22, 2014

Multiplication table of parsed argument number

//Write a program which accepts an int
//from command line argument and display
// the multiplication table for its number
class p405
{
        public static void main(String args[])
        {
                int n=Integer.parseInt(args[0]);
                int i;
                for(i=1;i<=12;i++)
                    System.out.println(i + "*" + n + "=" + i*n);
              
        }
}

No comments:

Post a Comment