Advertisement
VelizarAvramov

08. Refactor Volume of Pyramid

Nov 15th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.59 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Demo
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double length, width, heigth = 0;
  10.  
  11.             Console.Write("Length: ");
  12.             length = double.Parse(Console.ReadLine());
  13.  
  14.             Console.Write("Width: ");
  15.             width = double.Parse(Console.ReadLine());
  16.  
  17.             Console.Write("Height: ");
  18.             heigth = double.Parse(Console.ReadLine());
  19.  
  20.             double volume = (length * width * heigth) / 3;
  21.             Console.WriteLine("Pyramid Volume: {0:F2}", volume);
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement