-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA3q7.java
More file actions
32 lines (32 loc) · 696 Bytes
/
Copy pathA3q7.java
File metadata and controls
32 lines (32 loc) · 696 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
import java.util.*;
class Area
{
final double pi=3.14;
void aoc()
{
int r;
Scanner sc=new Scanner(System.in);
System.out.println("enter the radius of circle ");
r=Integer.parseInt(sc.nextLine());
System.out.println("area of circle is "+(pi*r*r));
}
void aocyl()
{
int r,h;
Scanner sc=new Scanner(System.in);
System.out.println("enter the radius of cylinder ");
r=Integer.parseInt(sc.nextLine());
System.out.println("enter the height of cylinder ");
h=Integer.parseInt(sc.nextLine());
System.out.println("area of cylinder is "+((2*pi*r)*(h+r)));
}
}
class A2q7
{
public static void main(String []args)
{
Area aa=new Area();
aa.aoc();
aa.aocyl();
}
}