Solid rectangle pattern in java.


import java.util.*;

public class solidrectangle {
    public static void main(String[] args) {
        int n,m;
        Scanner sc=new Scanner(System.in);
        System.out.println("enter value of row=");
        n=sc.nextInt();
        System.out.println("enter value of column=");
        m=sc.nextInt();
        for(int i=1; i<=n; i++){
            for(int j=1; j<=m; j++){
                System.out.print("*");
            }
            System.out.println();
        }
    }
}
■》Output->

enter value of row= 3 
enter value of column=6

******
******
******
-------------------------------------------------------------------

   

Comments

Popular posts from this blog

Introduction of java Programming language.

Stack data structure.