Answer:
public static void displayPattern()
{
for (int x = 1; x <= 5; x++)
for (int i = 0; i <= 6; i++)
if (x == i)
System.out.print(" ");
} else {
System.out.print("X");
}
System.out.println("");
3.6m questions
4.7m answers