-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQ_34.java
More file actions
31 lines (26 loc) · 713 Bytes
/
Q_34.java
File metadata and controls
31 lines (26 loc) · 713 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
package New;
import java.util.Scanner;
public class Q_33 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc=new Scanner(System.in);
System.out.println("Enter the radius");
double radius=sc.nextDouble();
double area=circleArea(radius);
System.out.println("Area of Circle="+area);
double perimeter=circlePerimeter(radius);
System.out.println("Perimeter of Circle="+perimeter);
}
public static double circleArea(double radius) {
return 3.14*radius*radius;
}
public static double circlePerimeter(double radius) {
return 2*3.14*radius;
}
}
/*Output
Enter the radius
3
Area of Circle=28.259999999999998
Perimeter of Circle=18.84
*/