pLs answer fast no spamming
Share
pLs answer fast no spamming
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Question:-
1 1 1 1 1 1
1 2 2 2 2 2
1 2 3 3 3 3
1 2 3 4 4 4
1 2 3 4 5 5
1 2 3 4 5 6
Answer:-
//Program to print the square pattern
package Programmer;
public class SquarePatt
{
public static void main (String ar [])
{
for (int I=1;I<=6;I++)
{
for(int j=1;j<=I;j++)
{
System.out.print(j+" ");
}
for(int j=I;j<=5;j++)
{
System.out.print(I+" ");
}
System.out.println();
}
}
}
_________
Variable Description:-
______
Explaination:-
_
• Output attached
Verified answer
Answer:
this is loop program
use for loop inside one nested loop and track your i and j then print
external i when end then put new line
do that yourself