Pageviews

Sunday 18 August 2013

Java program to print table of a number

by Unknown  |  in Source Codes at  Sunday, August 18, 2013

This program displays the table of the number entered by the user using the Scanner class.

Java program to print the multiplication table of a number


import java.util.Scanner;
public class Table {


    
    public static void main(String args[])  {
     
      
        System.out.println("Enter  number ");
      
        Scanner inputReader = new Scanner(System.in);
       
      
  int a = inputReader.nextInt();
int n,b;
for( n=1;n<=10;n++)
{

b=n*a;
System.out.println("Table is"+b);
}
}
}

Output of the program is:

Table



0 comments:

Proudly Powered by Blogger.