Calculate Area and Perimeter of Rectangle in C++

Google Advertisements

Prev Tutorial Next Tutorial

C++ Program to Calculate Area and Perimeter of Rectangle

To calculate area and perimeter of a square and rectangle we need length and breadth of the rectangle. First we receiver two variable from user using Cin>> function. and print output on screen using cout>> function

To understand below example, you have must knowledge of following C++ programming topics; Cin and Cout Function in C++ Here Cout<< Function in C++ are used for print output on screen and Cin>> function in C++ are used for get input from user.

C++ Program to Calculate Area and Perimeter of Rectangle

#include<iostream.h>
#include<conio.h>

void main()
{
 clrscr();
 int len, bre, peri, area;
 cout<<"Enter Length and Breadth of the Rectangle: ";
 cin>>len>>bre;
 area=len*bre;
 peri=(2*len)+(2*bre);
 cout<<"Area of Rectangle: "<<area<<"\tPerimeter Rectangle: "<<peri;
 getch();
}

Output

Enter Length and Breadth of the Rectangle: 10 20
Area Rectangle: 200
Perimeter Rectangle: 60
c++ program to calculate area and permeter of rectangle
Prev Tutorial Next Tutorial

Google Advertisements

We have more than 5 Groups which have 500000+ Members and some Pages have more than 100000+ members. If you want to post your article on our website/FB Group/FB Page please contact on hitesh.xc@gmail.com or 8076671483

Buy This Ad Space @$50 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 8076671483

Path variable is set for providing path for all Java tools like java, javac, javap, javah, jar, appletviewer which are used in java programming. All these tools are available in bin folders so we set path upto bin folders. Difference between path and classpath in Java

Classpath variable is set for providing a path for predefined Java classes which is used in our application. All classes are available in lib/rt.jar so we set classpath upto lib/rt.jar. Difference between path and classpath in Java

Cloud computing is the on demand availability of computer system resources, especially data storage and computing power, without direct active management by the user. Cloud Computing Tutorial

College Projects Related to Java, AWT, C Projects for College, C++ Projects for College, Android Projects. Download Java C C++ Projects

Download Projects

Adsense Advertisements


Buy This ads Space 8076671483

Buy This Ad Space @$120 per Month, Ad Size 300X600 Contact on: hitesh.xc@gmail.com or 8076671483 Try this Keyword C++ Programs