-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram114.java
More file actions
66 lines (47 loc) · 1.09 KB
/
Copy pathprogram114.java
File metadata and controls
66 lines (47 loc) · 1.09 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
// Input : 4 4
/*
*
* *
* * *
* * * *
*/
import java.util.*;
class Pattern{
public void Display(int iRow ,int iCol)
{
int i = 0, j = 0;
if(iRow != iCol)
{
System.out.println("Invalid input");
return;
}
for( i = 1; i <= iRow ; i++)
{
for(j = iCol ; j >= 1; j--)
{
if(i >= j)
{
System.out.print("*\t");
}
else
{
System.out.print(" \t");
}
}
System.out.println("\n");
}
}
}
public class program114 {
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);
}
}