-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExponent2.java
More file actions
37 lines (28 loc) · 799 Bytes
/
Exponent2.java
File metadata and controls
37 lines (28 loc) · 799 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
import javax.swing.JOptionPane;
public class Exponent2
{
public static void main (String [] args)
{
int num1;
int num2;
String result;
result = JOptionPane.showInputDialog(null, "Enter a number");
num1 = Integer.parseInt (result);
num2= Integer.parseInt (result);
Squared(num1, num2);
JOptionPane.showMessageDialog (null, "Cube is " + Cube (num1, num2));
}
public static void Squared (int i, int j)
{
int ans;
ans = (i * j);
JOptionPane.showMessageDialog(null, "Squared is " + ans);
}
public static int Cube (int i, int j)
{
int ans;
ans = i * i * j;
return ans;
}
public static int
}