C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
Program to find the volume of the coneThe cone can be defined as the three dimensional object with a circular base. The volume of the cone is measured in cubic units. Be sure that all of the measurements are in the same unit before computing the volume. Formulavolume of cone= pie x r2 x h/3 Algorithm
ComplexityO(1) SolutionC ProgramC Program: #include Output: Volume of the cone=48766.666667 PHP Program<?php $height=38; $radius=35; $pie=3.14285714286; $volume=$pie*($radius*$radius)*$height/3; echo "Volume of the cone="; echo $volume; ?> Output: The volume of the cone=48766.666666711 Java Programpublic class cone{ public static void main(String args[]) { int height=38; int radius=35; double pie=3.14285714286; double volume=pie*(radius*radius)*height/3; System.out.println("Volume of the cone="+volume); } } Output: Volume of the cone=48766.666666711004 C# Programusing System; public class Program { public static void Main() { int height=38; int radius=35; double pie=3.14285714286; double volume=pie*(radius*radius)*height/3; Console.WriteLine("Volume of cone="+volume); } } Output: Volume of cone=48766.666666711 Python Programheight=38 radius=35 pie=3.14285714286 volume=pie*(radius*radius)*height/3 print("volume of the cone="+str(volume)) Output: Volume of cone=48766.666666711
Next Topic#
|