-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram106.java
More file actions
53 lines (38 loc) · 1002 Bytes
/
Copy pathprogram106.java
File metadata and controls
53 lines (38 loc) · 1002 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Input : 4 4
/*
*/
import java.util.*;
class Pattern{
public void Display(int iRow ,int iCol)
{
int i = 0, j = 0;
for( i = 1; i <= iRow ; i++)
{
for(j = 1 ; j <= iCol; j++)
{
if(( j == 1) || (j == iCol) || (i == 1) || (i == iRow))
{
System.out.print("*\t");
}
else
{
System.out.print(" \t");
}
}
System.out.println("\n");
}
}
}
public class program106 {
public static void main(String[] args) {
int iValue1 = 0;
int iValue2 = 0;
Scanner sobj = new Scanner(System.in);
System.out.println("Enter Number of Row :");
iValue1 = sobj.nextInt();
System.out.println("Enter Number of Columns :");
iValue2 = sobj.nextInt();
Pattern pobj = new Pattern();
pobj.Display(iValue1,iValue2);
}
}