Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

1.

PROGRAM

public class ForLoopDemo

public static void main(String[] args)

int n=5;

for (int i = 0; i < n; i++)

for (int j = 0; j < n; j++)

System.out.print("A");

System.out.println();

2.PROGRAM

public class ForLoopDemo

public static void main(String[] args)

int n=5;
for (int i = 0; i < n; i++)

for (int j = 0; j < n; j++)

System.out.print((char)(j+65));

System.out.println();

3.PROGRAM

public class ForLoopDemo

public static void main(String[] args)

int n=5;

int k=65;

for (int i = 0; i < n; i++)

for (int j = 0; j < n; j++)

System.out.print((char)(j+k));

}
k=k+5;

System.out.println();

You might also like