Zaarm TechZaarm Tech

Finding the area and perimeter of a rectangle

How tofind the area and perimeter of a rectangle in C++

1 Answer

<code> #include&lt;iostream.h&gt; #include&lt;conio.h&gt; void main() { int length, width; int perimeter, area; clrscr(); cout&lt;&lt; &quot;Length = &quot;; cin&gt;&gt; length; cout&lt;&lt; &quot;Width = &quot;; cin&gt;&gt; width; perimeter = 2*(length+width); area = length*width; cout&lt;&lt;endl&lt;&lt; &quot;Perimeter is &quot;&lt;&lt;perimeter; cout&lt;&lt;endl&lt;&lt; &quot;Area is &quot;&lt;&lt;area; getch(); } </code>

saam

Post an answer