1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Vaselesa [24]
3 years ago
9

How can i write a java program to display the multiplication table for the number entered by the user and the values doesn’t exc

eed 100 .For example if the user enter 3 the output should be like this :
3

6

9

12

15

18

21

24

27

30

33

36

39

42

45

48

51

54

57

60

63

66

69

72

75

78

81

84

87

90

93

96

99
Computers and Technology
1 answer:
malfutka [58]3 years ago
3 0

Answer:

import java.util.Scanner;

public class Main {

 public static void main(String[] args) {

   Scanner input = new Scanner(System.in);

   System.out.println("Enter an integer");

   int num = input.nextInt();

   int i=1;

   while( i*num < 100) {

      System.out.println(i*num);

      i++;

   }

   input.close();

 }

}

Explanation:

If you want the value 100 to be included, change the < to <=.

You might be interested in
Java
Valentin [98]

Answer:

import java.util.Scanner;

public class LabProgram{

    public static void main(String []args){

       Scanner input = new Scanner(System.in);

       int red,blue,green,smallest;

       System.out.print("Enter three numbers between 0 and 255 (inclusive): ");

       red =input.nextInt();

       green =input.nextInt();

       blue =input.nextInt();

       

       if(red <= blue && red <= green){

       smallest = red;

       }

       else if(green <= red && green <= blue){

           smallest = green;

       }

       else{

            smallest = blue;

       }

       System.out.print((red - smallest)+" "+(green - smallest)+" "+(blue - smallest));

}

}

Explanation:

This line declares necessary variables

int red,blue,green,smallest;

This line prompts user for input of 3 numbers

System.out.print("Enter three numbers between 0 and 255 (inclusive): ");

The next three lines gets user inputs

       red =input.nextInt();

       green =input.nextInt();

       blue =input.nextInt();

The following iteration checks for the smallest for red, green, blue

       if(red <= blue && red <= green){

       smallest = red;

       }

       else if(green <= red && green <= blue){

           smallest = green;

       }

       else{

            smallest = blue;

       }

This line prints the required output

       System.out.print((red - smallest)+" "+(green - smallest)+" "+(blue - smallest));

3 0
3 years ago
Which is the output of the formula =XOR(120&lt;102;83=83;51&lt;24)??
Greeley [361]
The output of the formula will be TRUE because '83 = 83' is the only true expression of that three expressions present in the formula.
The output of the XOR function will be TRUE in case only one logical expression is true and FALSE otherwise.
7 0
4 years ago
Read 2 more answers
Polls shows that most Americans....
Len [333]
I dont know whats the contexts behind this uestion but i think the answer is B
6 0
3 years ago
The ___________ method returns the length of an array.
MaRussiya [10]

Answer:

A. Append

Explanation:

4 0
3 years ago
Read 2 more answers
What is a spark line? how is a different a chart​
Neporo4naja [7]

Answer:

A sparkline is a tiny chart in a worksheet cell that provides a visual representation of data.

5 0
3 years ago
Other questions:
  • What type of memory can support quad, triple, and dual channels?
    5·1 answer
  • Given an integer variable count, write a statement that displays the value of count on the screen. Do not display anything else
    11·1 answer
  • 3. The combination of keys that we should press to select all document is
    14·1 answer
  • What is not true of credit scores?
    11·1 answer
  • A printer would be considered _____. Select 2 options. 1 an input device 2 an output device 3 hardware 4 software 5 storage
    10·1 answer
  • One shortcoming of rapid application development (RAD) is _____.
    9·1 answer
  • Write a method, including the method header, that will receive an array of integers and will return the average of all the integ
    7·1 answer
  • Which component of the computer keeps the operating system when the computer is running​
    10·1 answer
  • While storms could be a cause, power______ are more likely to be caused by disturbances from high-demand equipment in a home or
    8·1 answer
  • Who benefits the most from billing by the second for cloud resources, such as virtual machines?.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!