Question: write a program to Print the following triangle for n = 5 using nested loops. Hint: For, n=1, the output will be For, n=2, the

write a program to  Print the following triangle for n = 5 using nested loops. 



Hint:  For, n=1, the output will be For, n=2, the output will be 1 1 1 1 1 For, n=3, the output will be 1 1 3

Hint: For, n=1, the output will be For, n=2, the output will be 1 1 1 1 1 For, n=3, the output will be 1 1 3 3 3 3 1 1 1 10 10 5 5 5 3 7 7 9 1 1 3 1 3 5 So, for, n=5, there will be 5 rows (i.e., lines) in the output. 2n-3 2n-3 Hint: For, n=1, the output will be For, n=2, the output will be 1 1 1 1 1 For, n=3, the output will be 1 1 3 3 3 3 1 1 1 10 10 5 5 5 3 7 7 9 1 1 3 1 3 5 So, for, n=5, there will be 5 rows (i.e., lines) in the output. 2n-3 2n-3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Java public class ... View full answer

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 Programming Questions!