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]
4 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]4 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
If there is a combination of two or more attributes which is being used as the primary key then we call it as
Hunter-Best [27]

Answer:

Composite Keys.

.....Wubba Lubba Dub-Dub :))

5 0
3 years ago
When the system denies access to someone who is authorized it is called a - false negative?
babunello [35]
The computer declined the process for the password
5 0
4 years ago
Who want to go on scratch<br> I really need people to favorite and like my projects
mariarad [96]

Answer:

Sure

Explanation:

6 0
3 years ago
Read 2 more answers
Which of the following statements is not true of web storage?
slavikrds [6]

Answer:

The data in web storage is passed to the server with every HTTP request.

Explanation:

There are basically two Web storage APIs Session storage and local storage.Both can store data up to 5MB. They are supported by every modern browser.You can store data in local storage indefinitely and for browser session in session storage.There is no data or information in HTTP request header.So we conclude that option 4 is the answer.

3 0
3 years ago
What does 69 mean?<br> Whenever I watch memes they always talk about the number 69
Makovka662 [10]
Just- you don’t wanna know alr? Alr :)
5 0
3 years ago
Read 2 more answers
Other questions:
  • Complete each statement by choosing the correct answer from the drop-down menu.
    10·1 answer
  • To find the largest number in a list of numbers, use the _____.
    8·1 answer
  • Alice just wrote a new app using Python. She tested her code and noticed some of her lines of code are out of order. Which princ
    8·1 answer
  • Little circles located in front of various website screen options, which can be selected with the mouse, are called ________.
    6·1 answer
  • When using a search engine, what is the name of a word or phrase somebody types to find something online?
    12·2 answers
  • If your computer won't connect to the internet, which of these is most likely to be the problem?
    8·1 answer
  • When a recursive algorithm terminates its nth instance of the module call, it returns to the point in the ________ instance dire
    11·1 answer
  • 4. What is the package name in which the Scanner class resides?
    14·1 answer
  • What is output? Select all that apply. c = 0 while (c &lt; 5): c = c + 1 print(c) 6 5 2 4 3 0 1
    9·1 answer
  • You just upgraded five computers with new, larger, hard drives. Now you would like to securely repurpose the old hard drives so
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!