Table of a Number with for.

 PRINT TABLE OF A NUMBER USING FOR... 


**********************************


import java.util.Scanner;
public class PrintTable
{
    public static void main(String args[])
    {
      Scanner sc=new Scanner(System.in);
      System.out.println("ENTER A NUMBER");
      int num= sc.nextInt();
  
      for(int i=1; i<=10; i++)
      {
          System.out.println(num+ "x" +i+ "=" + (i*num));
      }    
    }
}

**********************************
BY-BLUEJ HUB





Post a Comment

0 Comments