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 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
Java public class ... View full answer
Get step-by-step solutions from verified subject matter experts
