C# program to calculate parallelogram circumference

Views: 158   

Following program shows you how to calculate parallelogram circumference.
This program gets parallelogram base and side from user and calculates circumference and prints it using following formula
`Circumference = 2 X base X side

using System;

class MainClass {
  public static void Main (string[] args) {
    Console.WriteLine ("Please enter base of parallelogram:");
    double parallelogramBase = Convert.ToDouble(Console.ReadLine());

     Console.WriteLine ("Please enter side of parallelogram:");
    double parallelogramSide = Convert.ToDouble(Console.ReadLine());

    double circumferenceOfParallelogram = 2 * (parallelogramBase + parallelogramSide);
    Console.WriteLine("Circumference of parallelogram is: " + circumferenceOfParallelogram);



Please enter base of parallelogram:
Please enter side of parallelogram:
Circumference of parallelogram is: 120
On By