logo image

C# program to calculate parallelogram area


Fallowing program shows you how to calculate parallelogram area. This program gets parallelogram base and height from user and calculates area and prints it using following formula Area = base X height

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 height of parallelogram:");
    double parallelogramHeight = Convert.ToDouble(Console.ReadLine());

    double areaOfParallelogram = parallelogramBase * parallelogramHeight;
    Console.WriteLine("Area of parallelogram is: " + areaOfParallelogram);



Please enter base of parallelogram:
Please enter height of parallelogram:
Area of parallelogram is: 180