Computer Science, asked by dhruv909982, 1 year ago

Write a java program to calculate the total surface area, curved surface area and volume of cylinder(formula:- (TSA=2πr(r+h),CSA=2πrh,volume =πr2h))

Answers

Answered by Punya2138
4

class Cylinder

{ public void calc(double r,double h)

double tsa=2.0*3.14*r*(r+h);

System.out.println("Total surface area ="+tsa);

double csa=2.0*3.14*r*h;

System.out.println("Curved surface area ="+csa);

double vol=3.14*r*r*h;

System.out.println("Volume="+vol);

}

Similar questions