TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

program to find the area of parallelogram

program to find the area of parallelogram on fibonacci, factorial, prime, armstrong, swap, reverse, search, sort, stack, queue, array, linkedlist, tree, graph etc.

<< Back to PROGRAM

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.

Formula

Area of parallelogram= base x height

Algorithm

  1. Define the base of the parallelogram.
  2. Define the height of the parallelogram.
  3. Calculate the area of the parallelogram as base X height

Complexity

O(1)


Solution

C Program

#include 
int main()
{
  int base=4;
  int height=18;
  int area_parallelogram=base*height;
  printf("Area of the parallelogram=%d",area_parallelogram);
  return 0;
}

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#




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf