Computer Science, asked by inderritu123, 11 months ago

Q2.W.A.P to calculate area of circle and volume of sphere where r=7.
Area of circle = pr. (where p=3.14)
Volume of sphere =4/3pr (where p=3.14)​

Answers

Answered by jyotimehra0708
2

Answer:

class Area{

int r=7;

int p=3.14;

public void circle(){

int a=p*r*r;

System.out.println(a);

}

public void sphere(){

int aa=(4/3) *p*r*r*r;

System.out.println(aa);}

public static void main(String args[]){

Area aaa=new Area();

aaa.circle();

aaa.sphere();

}}

Explanation:

Similar questions