-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram102.java
More file actions
48 lines (36 loc) · 882 Bytes
/
Copy pathprogram102.java
File metadata and controls
48 lines (36 loc) · 882 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
// Input : 4 4
/*
a a a a
B B B B
c c c c
D D D D
*/
import java.util.*;
class Pattern{
public void Display(int iRow ,int iCol)
{
int i = 0, j = 0;
int iCnt = 0;
for( i = 1,iCnt = 1 ; i <= iRow ; i++)
{
for(j = 1 ; j<= iCol; j++,iCnt++)
{
System.out.print(iCnt +"\t");
}
System.out.println("\n");
}
}
}
public class program102 {
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);
}
}