-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathYT31.java
More file actions
68 lines (53 loc) · 1.32 KB
/
YT31.java
File metadata and controls
68 lines (53 loc) · 1.32 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
67
68
import java.io.*;
class YT31
{
public void Display()
{
String n="97531";
while(n.length()>0)
{
System.out.println(n);
n=n.substring(1);
}
}
public void Display(int num)
{
int min=10;
int r;
while(num>0)
{
r=num%10;
if(min>r)
{
min=r;
}
num=num/10;
}
System.out.println("Min: "+min);
}
public void Display(int p, int q)
{
int f=1;
for(int i=1; i<=q; i++)
{
f=f*p;
}
System.out.println("P to the power Q: " +f);
}
public static void main(String[] args)throws IOException
{
int n1, p1, q1;
InputStreamReader I = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(I);
System.out.println("enter the n:");
n1=Integer.parseInt(br.readLine());
System.out.println("enter the p:");
p1=Integer.parseInt(br.readLine());
System.out.println("enter the q:");
q1=Integer.parseInt(br.readLine());
YT31 y1 = new YT31();
y1.Display();
y1.Display(n1);
y1.Display(p1, q1);
}
}