Skip to content

Latest commit

 

History

History
75 lines (56 loc) · 690 Bytes

File metadata and controls

75 lines (56 loc) · 690 Bytes

Nested Loops


 nest


Q1. Write a java method that returns the following String:

1 
1 2 
1 2 3 
1 2 3 4 
1 2 3 4 5 

Q2. Write a java method that returns the following String:

1 
1 2 
1 2 3 
1 2 3 4 
1 2 3 4 5 
1 2 3 4 
1 2 3 
1 2 
1 

Q3. Write a java method that returns the following String:

1 2 3 4 5 
1 2 3 4 
1 2 3 
1 2 
1 
1 2 
1 2 3 
1 2 3 4 
1 2 3 4 5  

Q4. Write a java method that returns the following String:

5 4 3 2 1 
4 3 2 1 
3 2 1 
2 1 
1 

Q5. Write a java method that returns the following String:

5 4 3 2 1 
4 3 2 1 
3 2 1 
2 1 
1 
2 1 
3 2 1 
4 3 2 1 
5 4 3 2 1