C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
Program to find the area of the parallelogram
The parallelogram is a four-sided plane rectilinear figure with opposite sides parallel. A parallelogram is a simple object in 2D space having two parallel sides. The opposite sides and the angles are identical in parallelogram. FormulaArea of parallelogram= base x height Algorithm
ComplexityO(1) SolutionC Program#include Output: Area of the parallelogram=72 PHP Program
<?php
$base=4;
$height=18;
$area_parallelogram=$base*$height;
echo "Area of the parallelogram=";
echo $area_parallelogram;
?>
Output: Area of the parallelogram=72 Java Program
public class parallelogram{
public static void main(String args[])
{
int base=4;
int height=18;
int area_parallelogram=base*height;
System.out.println("Area of the parallelogram="+area_parallelogram);
}
}
Output: Area of the parallelogram=72 C# Program
using System;
public class Program
{
public static void Main()
{
int base1=4;
int height=18;
int area_parallelogram=base1*height;
Console.WriteLine("Area of the parallelogram="+area_parallelogram);
}
}
Output: Area of the parallelogram=72 Python Program
base=4
height=18
area_parallelogram=base*height
print("Area of the parallelogram="+str(area_parallelogram))
Output: Area of the parallelogram=72
Next Topic#
|