Advertisement
LegendSujay2019

Java Program To Print Table of Number

Aug 26th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1. /* Java Program Example - Print Table of Number */
  2.        
  3. import java.util.Scanner;
  4.  
  5. public class JavaProgram
  6. {
  7.     public static void main(String args[])
  8.     {
  9.         int num, i, tab;
  10.         Scanner scan = new Scanner(System.in);
  11.        
  12.         System.out.print("Enter a Number : ");
  13.         num = scan.nextInt();
  14.        
  15.         System.out.print("Table of " + num + " is\n");
  16.         for(i=1; i<=10; i++)
  17.         {
  18.             tab = num*i;
  19.             System.out.print(num + " * " + i + " = " + tab + "\n");
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement