Print Star Rectangle in Java
Previous | Home | Next |
Print Star Rectangle in Java
//Following program for print Star in Rectangular Form
package r4r.co.in;
import java.io.*;
public class NewClass {
public static void main(String[] args) throws IOException {
BufferedReader Digit = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter the the row :");
String s1 = Digit.readLine(); //Input row
System.out.println("Enter the the Column :");
String s2 = Digit.readLine(); //Input Column
int n1 = Integer.parseInt(s1);
int n2 = Integer.parseInt(s2);
//Code for Rectangle print
for (int i = 1; i <= n1; i++) {
for (int j = 1; j <= n2; j++) {
System.out.print("*");
}
System.out.print("\n");
}
}
}
Enter the the row :
10
Enter the the Column :
10
**********
**********
**********
**********
**********
**********
**********
**********
**********
**********
Previous | Home | Next |