Question: Java You are required to develop a program that reads a non-negative integer n and displays a right triangle of n asterisks in height and

Java

You are required to develop a program that reads a non-negative integer n and displays a right triangle of nasterisks in height and n asterisks in base.

Input Format

A single line with n.

Constraints

n must be a non-negative integer.

Output Format

A triangle of asterisks. That is, the first line will have 1 asterisk, the second line will have 2 asterisks, the third line will have 3 asterisks, and so on. The last line (line n) will have n asterisks.

Sample Input 0

4 

Sample Output 0

* ** *** **** 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!