Computer Science, asked by akki3245, 7 months ago

write a program to calculate and print volume of sphere.input the radius using scanner class.
volume of sphere =4/3πr3​

Answers

Answered by Legend42
7

Answer:

The formula to determine the volume of a sphere is 4/3π multiplied by r, the radius, cubed, where π, or pi, is a nonterminating and nonrepeating mathematical constant commonly rounded off to 3.1416. Since we know the volume, we can plug in the other numbers to solve for the radius, r. Multiply the volume by 3.

↷alle follow toh kar do

Answered by rahmanbinjaffar
2

Answer:

import java.io.*;

import java.util.*;

public class Volume_Of_Sphere{

   public static void main(String args[]) {

      Scanner sc = new Scanner(System.in);

      int radius=sc.nextInt();

      double pie=3.14285714286;  

      double volume=(4.0/3.0)*pie*(radius*radius*radius);  

      System.out.println("Volume of the sphere="+volume);  

   }

}

Mark as brainliest : )

Similar questions