Answer to Question #317901 in Java | JSP | JSF for lolo

Question #317901

1.      Write a program in Java to display a right-angled triangle pattern with numbers, as shown below.

Expected Output :

1                                                                               

12                                                                              

123                                                                             

1234                                                                            

12345                                                                           

123456                                                                          

1234567                                                                         

12345678                                                                        

123456789                                                                       

12345678910

 

   

 




1
Expert's answer
2022-03-25T08:40:50-0400


class App {


	public static void main(String[] args) {
		for (int i = 1; i <= 10; i++) {
			for (int j = 1; j <= i; j++) {
				System.out.print(j);
			}
			System.out.println();
		}
	}


}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS