answersLogoWhite

0


Best Answer

#include <stdio.h>

#include <stdlib.h>

int main(int argc, char *argv){

if(argc != 3){

printf("Gimme two dimensions\n");

}else{

printf("The area is %i\n", (atoi(argv[1]) + atoi(argv[2])) << 1);

}

return 0;

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: C program to find the perimeter of rectangle?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a C program to find the area and perimeter of you square ii rectangle?

#include&lt;stdio.h&gt; void main() { float length, breadth, area, perimeter; printf("Enter the length &amp; breadth of a Rectangle\n(length breadth): "); scanf("%f %f",&amp;length,&amp;breadth); area=length*breadth; perimeter=2*(length+breadth); printf(" Area of the Rectangle=%0.3f\n",area); printf("Perimeter of the Rectangle=%0.3f\n",perimeter); printf("(Press ENTER to exit.)"); getch(); printf("\n"); }


Write a c program to find the area and perimeter of circle?

Learn c programming and geometry. It will be easy when you know both.


How do you find an area of a shape rectangle square and a circle in C program?

By using that one thing.


How do find the length of a rectangle if the perimeter and width is given?

Assuming the object is a rectangular parallelepiped, use its density to find its volume and solve the equation V abc for c where a, b, and c are the height, length and width respectively


What is a c program to find the area and perimeter of circle?

void main() { float pi=3.14,area,perimeter,r=2; area=pi*r*r; perimeter=2*pi*r; getch(); }


How do you do perimeter do you multiply?

Perimeter is the distance around an object. Perimeter of a square = 4x Side length Perimeter of a Rectangle = 2 x Length + 2 x Width Perimeter of a Triangle = A+B+C Perimeter of a circle = 2 pi r


How do you find perimeter of a triangle?

It,s easy. a+b+c= perimeter


Write a program to find the area of circle in c?

PROGRAM TO FIND AREA & PERIMETER OF CIRCLE IN C++#include #include void main(){clrscr();double rad, area, perimeter;coutrad;area=3.14*rad*rad;perimeter=2*3.14*rad;cout


How do you find the perimeter of a trangle?

a+b+c


Show that among all rectangles with area A the square has the minimum perimeter?

Suppose sqrt(A) = B ie the square with sides B has an area of A and its perimeter is 4*B. Now consider a rectangle with sides C and D whose area is A. So C*D = A = B*B so that D = B*B/C Perimeter of the rectangle = 2*(C+D) = 2*C + 2*D = 2*C +2*B*B/C Now consider (C-B)2 which, because it is a square, is always &gt;= 0 ie C*C + B*B - 2*B*C &gt;= 0 ie C*C + B*B &gt;= 2*B*C Multiply both sides by 2/C (which is &gt;0 so the inequality remains the same) 2*C + 2*B*B/C &gt;= 4*B But, as shown above, the left hand side is perimeter of the rectangle, while the right hand side is the perimeter of the square.


How do you write a c program to find area of rectangle using function?

There will be a function in it like this: double RectangleArea (double a, double b) { return a*b; }


C program to find area and perimeter of triangle?

To find the area and perimeter of a triangle in a C program, you would first need to input the three sides of the triangle. Then, you can calculate the perimeter by adding the three sides together. Next, you can calculate the semi-perimeter by dividing the perimeter by 2. Finally, you can use Heron's formula to calculate the area of the triangle using the semi-perimeter and the three sides. The C program would involve taking user input, performing the necessary calculations, and outputting the results.