Computer Science, asked by MasterQuestioner, 1 year ago

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 duragpalsingh
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 Anonymous
7

hi there

good question.

check the solution in the pic

Attachments:
Similar questions