Write a program to input the radius and height of a cylinder and find its volume and total surface area.
Class 9 - Computer Applications - Ch 5 - Input in JAVA
Answers
Answered by
17
Hey there!
Program to input the radius and height of a cylinder and find its volume and total surface area.
import java.util.*;
public class Question9
{ static void main()
{
Scanner sc=new Scanner(System.in);
float radius,height,vol,area;
System.out.println("Enter radius and height of a cylinder:");
radius=sc.nextFloat();
height=sc.nextFloat();
vol=(float)22/7*radius*radius*height;
area=2*(float)22/7*radius*(radius+height);
System.out.println("Volume of cylinder="+vol);
System.out.println("Total Surface Area="+area);
}
}
Hope It Helps You!
Answered by
7
hi there
good question.
check the solution in the pic
Attachments:
Similar questions
English,
6 months ago
English,
6 months ago
Chemistry,
6 months ago
Business Studies,
1 year ago
Math,
1 year ago