Monday, 12 August 2013

W.A.P. to Prints multiplication table of a number entered by the user using a for loop.

import java.util.Scanner;
class Mul
{
    public static void main(String []args)  
    {
        int n,c;
        System.out.println("Enter an integer to print it's

multiplication table");
  
    Scanner in=new Scanner(System.in);
    n=in.nextInt();
    System.out.println("Multiplication Table Of "+n+" is :-");

    for(c=1;c<=10;c++)

    System.out.println(n+"*"+c+" = "+(n*c));
    }


}














0 comments:

Post a Comment

Followers