I am a beginner in java programming and I need help to use nested loop to print out the following pattern on the screen. The first number in each pair represents the row number and the second one represents the column number.
The sample output is:
1,1 1,2 1,3 1,4
2,1 2,2 2,3 2,4
3,1 3,2 3,3 3,4
Here is what I have done so far:
/*Use nested loop to print out the following pattern on the screen*/
class Pattern {
public static void main(String[] args){
int row =3;
int col =4;
for(i =0; i<row; i++)
{
for(intj=0; j<col; j++)
{
System.out.println(1,1 );
}
}
}