Computer Science, asked by RBTIGER, 9 months ago

wap to print the patten in java using for loop


12
1 2 3

Answers

Answered by percytrar
1

Answer:

I think u mean

1 2

1 2 3

Explanation: Not writing the whole java program just the logic!

  1. for(int i = 1; i <= 2 ; i++){
  2.     for(int j = 1; j <= i+1; j++)
  3.           System.out.print(j + " ");
  4.      System.out.println();
  5. }

Similar questions