-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathday 12 (inputs)
More file actions
25 lines (23 loc) · 822 Bytes
/
day 12 (inputs)
File metadata and controls
25 lines (23 loc) · 822 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
//write program in java that input an int from user , calculate and display the following suitable messeage
//a. display orianal value
//b.square value
//c. cube value
//d. square root value
//e. cube root value
import java.util.Scanner;
class goat07
{
public static void main(String[] args) {
try (Scanner sc = new Scanner(System.in)) {
System.out.println("insert any value");
int a = sc.nextInt();
System.out.println("ur value is :" + a);
int b = a * a;
System.out.println("square value:" + b);
int c = a * a * a;
System.out.println("cube value is :" + c);
System.out.println("square root value is :" + Math.sqrt(a));
System.out.println("cube root value is : " + Math.cbrt(a));
}
}
}