Solid Pattern Program In Java Language
import java.util.Scanner;
class Demo
{
public static void main(String args[])
{
Scanner sc= new Scanner(System.in);
System.out.println("Print Solid Pattern");
System.out.print("Enter the value of n: ");
int n = sc.nextInt();
System.out.print("Enter the value of n: ");
int m = sc.nextInt();
for(int i=1; i<=n; i++)
{
for(int j=1; j<=m; j++){
System.out.print("*");
}
System.out.println();
}
}
}
OUTPUT:
Print Solid Pattern
Enter the value of n: 4
Enter the value of n: 7
*******
*******
*******
*******
Comments
Post a Comment