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
Novay_Z [31]
3 years ago
12

Given an int variable n that has already been declared and initialized to a positive value, write a Java program that prints the

reverse triangle of asterisks with n asterisks on the first line (top of triangle), one less asterisk on the next level, and so on till 1 asterisk on the bottom level. (All asterisks aligned on the left, not centered in the middle, so you don’t need blanks. But think how you would have solved this problems if you’d need to center the triangle!)
Computers and Technology
1 answer:
Mars2501 [29]3 years ago
6 0

Answer:

The program to this question can be given as:

Program:

public class Main //define class.

{

public static void main(String[] as) //define main method.

{

int n=5; //define variable n and assign positive value.

int i,j; //define variable

for (i = 7; i>=1; i--) //outer loop.

{

for (j = 0; j< i; j++) //inner loop.

{

System.out.print("*"); //print asterisks.

}

System.out.println(); //line break.

}

}

}

Output:

*****

****

***

**

*

Explanation:

The description of the above code can be given as:

  • In the above java programming code firstly we define a class that is "Main". In this class we define a main method in the main method we define a variables that is "n" in this variable we assign a positive value. The we define another integer variable that is i,j this variable is used in the loop.
  • Then we define a loop. for prints asterisks values in reverse triangle, we nested looping concept. In nested looping, we use in loop in this loop we use the i and j variables that print the asterisks value.

You might be interested in
Why do we need the binary system?
nika2105 [10]

Answer:

We need to have binary numbers because that is how computers process data.

Explanation:

6 0
4 years ago
Which statement best describes the role of computing in entrepreneurship? Entrepreneurs can only be successful with modern compu
kykrilka [37]
Well according to e2020 the answer would be A. "Entrepreneurs can only be successful with modern computing technology."
5 0
4 years ago
CORYXKENSHIN IS BACKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK AND H
choli [55]

WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW

8 0
3 years ago
Read 2 more answers
Choose all of the devices where an operating system can be found.
den301095 [7]

Answer:

mainframe and desktop computers

smartphones

embedded devices controlling robots

5 0
3 years ago
Which year marked the arrival of private satellite television channels in India? Answer key - A)1982 B)1985 C)1991 D)1995
Lubov Fominskaja [6]
Up until 1991 there was only 1 public channel
4 0
3 years ago
Other questions:
  • If you are making a 30-minute presentation, how much time should be spent summarizing your points and making any closing remarks
    11·2 answers
  • Dustin runs a command at the command line trying to find out what kernel version the system is running. However, it doesn't give
    12·1 answer
  • To create a formula in______, you would first click in one of the cells​
    14·2 answers
  • How to do this PLEASE HELP 80 points!
    15·1 answer
  • Which fact does lean green eco machines present to show that electric cars are not perfect
    13·2 answers
  • Write a program that calculates and displays the amount ofmoney available in a bank account that initially has $8000 deposited i
    9·1 answer
  • Explain different types of networking-based attacks
    5·1 answer
  • What is multimedia hard ware? Write any four examples of multimedia hardware. <br>​
    13·1 answer
  • If a user wants to change one small section of the formatting of a document and leave the rest the same, which
    5·1 answer
  • Imagine an everyday scenario in which you are using the internet: downloading a file, uploading a photo, checking your email, et
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!