-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathYT37.java
More file actions
61 lines (50 loc) · 1 KB
/
YT37.java
File metadata and controls
61 lines (50 loc) · 1 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
//pattern 2023
public class YT37
{
public void print()
{
int a=1;
for(int i=1; i<=5; i++)
{
for(int j=1; j<=5; j++)
{
System.out.print(a+" ");
}
System.out.println();
a++;
}
}
public void print(int n)
{
int d=n;
int r;
int se=0, so=0;
while (d>0)
{
r=d%10;
if(r%2==0)
{
se=se+r;
}
else
{
so=so+r;
}
d=d/10;
}
if(se==so)
{
System.out.println("RESULT: Lead Number");
}
else
{
System.out.println("RESULT: Not a Lead Number");
}
}
public static void main(String[] args)
{
YT37 y1 = new YT37();
y1.print();
y1.print(3669);
}
}