Computer Science, asked by siddharth304, 1 month ago

Write the java program to accept the number and display the multiplication table without using scanner

Answers

Answered by atrs7391
1

/*

Project Type: Brainly Answer

Date Created: 10-02-2021

Date Edited Last Time: ---NIL---

Question Link: https://brainly.in/question/34931416

Question: Write the java program to accept the number and display

the multiplication table without using Scanner class.

Program Created By: atrs7391

Programming Language: Java

Language version (When program created or last edited): jdk-15.0.2

*/

package Brainly_Answers;

import java.io.IOException;

import java.io.InputStreamReader;

import java.io.BufferedReader;

public class Multiplication_Table {

   public static void main(String[] args) throws IOException {

       InputStreamReader ir = new InputStreamReader(System.in);

       BufferedReader br = new BufferedReader(ir);

       System.out.println("Enter a number: ");

       long n = Long.parseLong(br.readLine());

       // taking input from user and storing it into variable n

       System.out.println("Multiplication Table of "+n+": ");

       for (int i = 1; i <= 10 ; i++)

       // generating the multiplication table using for loop

       {

           System.out.println(n+" x "+i+" = "+(n*i));

           // printing the multiplication table

       }

   }

}

Similar questions