Menghitung Volume Tabung dan Kerucut C# Posted by Unknown on January 12, 2015 Get link Facebook X Pinterest Email Other Apps Dengan keterangan program : - Input berupa : Besaran Jari-jari dalam cm dan Besaran Tinggi dalam cm. - Rumus volume yang digunakan : Volume tabung = r2 x t Volume kerucut = 1/3 x π x r2 x t Dimana : r = jari-jari t = tinggi π = 22/7 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace MODUL2_3 { class Program { static void Main(string[] args) { int jari2, tinggi; float vt, vk; Console.Write("Input besaran Jari-Jari(cm) = "); jari2 = Convert.ToInt32(Console.ReadLine()); Console.Write("Input besaran Tinggi(cm) = "); tinggi = Convert.ToInt32(Console.ReadLine()); Console.WriteLine(); vt = (float)jari2 * jari2 * tinggi; vk = (float)1 / 3 * 22 / 7 * jari2 * jari2 * tinggi; Console.WriteLine("Volume Tabung = {0} cm3", vt); Console.WriteLine("Volume kerucut = {0} cm3", vk); Console.ReadKey(); } } } Comments
Comments
Post a Comment