package Pattern;
import java.util.Scanner;
public class Patterrn2 {
public static void main(String[] args) {
// using with help of while loop
Scanner scn=new Scanner(System.in);
int n=scn.nextInt();
int row=1;
while(row<=n) {
int col=1;
while(col<=n) {
System.out.println("*");
col=col+1;
}
System.out.println("*");
row=row+1;
}
}
}
In This programme output not coming like in a video pattern 1
like this
my output coming like this if gave input 3
*
*
*
*
*
*