Logo 
Search:

Unix / Linux / Ubuntu Articles

Submit Article
Home » Articles » Unix / Linux / Ubuntu » Homework HelpRSS Feeds

Program to calculate the area and perimeter of the rectangle

Posted By: Mohammad Evans     Category: Unix / Linux / Ubuntu     Views: 16704

The length and breadth of a rectangle and radius of a circle are input #through the Keyboard. Write a program to calculate the area and perimeter of the rectangle.

Code for Program to calculate the area and perimeter of the rectangle in Unix / Linux / Ubuntu

echo "Input length of a rectangle"
read length
echo "Input breadth of a rectangle "
read breadth
echo "Input radius of a circle "
read radius

area=`echo $length \* $breadth | bc`
perimeter=` echo 2 \* $length \* $breadth | bc`

echo "Area of the rectangle      : $area"
echo "Perimeter of the rectangle : $perimeter"
  
Share: 



Mohammad Evans
Mohammad Evans author of Program to calculate the area and perimeter of the rectangle is from London, United Kingdom.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!