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
SOVA2 [1]
3 years ago
8

Write code which prints every number from 1 to 20 a number of times equal to the number itself (e.g. one 1, two 2's...). Every i

ndividual number printed should be separated by a space, and there should be a new line each time the number changes. You should use nested loops to produce your output (it will result in far less code).
Partial sample run:

1
2 2
3 3 3
........

Note: Java
Computers and Technology
1 answer:
Oksi-84 [34.3K]3 years ago
6 0

public class JavaApplication71 {

   

   public static void main(String[] args) {

       for (int i = 1; i <= 20; i++){

           for(int w = 0; w < i; w++){

               System.out.print(i+" ");

           }

           System.out.println("");

       }

   }

   

}

I hope this helps!

You might be interested in
West Point Bridge Designer | Does anyone know a way to make this bridge cost less?
e-lub [12.9K]
Make the zig zag part more spaced out
4 0
3 years ago
4.9 Code Practice: Question 4
hichkok12 [17]

total = 0

i = 0

while i < 10:

   temp = float(input("Enter Temperature: "))

   total += temp

   i += 1

print("Sum =", str(total))

I hope this helps!

7 0
3 years ago
What is Microsoft Word an application used for word-processing, an example of?
LuckyWell [14K]

Microsoft word is an example of a graphical word program

7 0
3 years ago
Find and fix the error in the if-else statement. import java.util.Scanner;
salantis [7]

Answer:

Hi there Rumanruxi! The error is in the if statement "if(userNum = 2)".

Explanation:

The if statement in this Java code is assigning userNum the value of 2 instead of comparing it with the value of 2. For equals comparison we need to write two equals "==" in the statement as: "if (userNum == 2)". This will return true if userNum is 2 otherwise it will return false.  

3 0
3 years ago
Read 2 more answers
Code is the code or instructions used to create a Web page or<br> program.
Paha777 [63]
Answer:
HTML
Explanation:

5 0
3 years ago
Other questions:
  • Read the scenario and answer the question. Audrey had problems with her computer software recently. One of her programs shut dow
    12·2 answers
  • When recording data on a multiple-disk storage system, should we fill a complete disk surface before starting on another surface
    6·1 answer
  • 1) which colour filter is used to pumps up black and white effects?
    13·1 answer
  • .All of the following are true with the respect to implicitinvocation except:
    8·1 answer
  • In a game, your character cleverly places an electronic bug on an unsuspecting felon's jacket to track his movements. The bug tr
    10·2 answers
  • Trish has bought a new computer that she plans to start working on after a week. Since Trish has not used computers in the past,
    10·1 answer
  • teve wants to use Google Display Ads to reach new customers who are looking to purchase products similar to his. Which audience
    14·1 answer
  • Patronage of most Medieval musicians was supplied by the
    13·1 answer
  • Default tab stops are set in word every _______ inch. a. ¾ b. ½ c. 1 d. ¼
    7·1 answer
  • Difference between Computer safety practices and precautions
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!