1. Writhe output of the following code segments:
a.1 2 3 1 2 3 1 2 3
b. 1 2 3
1 2 3
1 2 3
2. Write code segments that solve the following problems:
a.Output the numbers 1 to 25 in consecutive order, using five rows of five numbers each.
-for(i=0; i<5; i++)
for(j=1; j<=5; j++)
System.out.print((i*5+j) + “”)
System.out.println(“”)
b.Output five rows of five numbers. Each number is the sum of its row position and column position. The position of the first number is (1,1):