![]() Given area and side length a calculate perimeter, diagonals and side b. At last, it prints the perimeter of rectangle on screen using printf function. p q (a 2 + b 2) Calculate P, p, b Given A, a. CBM Calculation Formula Length (in meter) X Width (in meter) X Height (in meter) Cubic meter (m3) We can define dimensions in Meter, Centimeter, Inch, Feet. To find the perimeter of rectangle we add the length and width of rectangle and then multiply it with 2(as per formula given above) and store perimeter in a floating point variable. Printf("Area of Rectangle : %0.4f\n", area) Ĭ Program to find the perimeter of the rectangleīelow program, first takes length and width as input from user using scanf function and stores in 'length' and 'width' variables. At last, it prints the area of rectangle on screen using printf function. To find the area of rectangle we multiple the length and width of rectangle and store area in a floating point variable. Below program, first takes length and width as input from user using scanf function and stores in 'length' and 'width' variables. To calculate area of a rectangle, we need length and width of a rectangle. Imagine a farmer trying to sell a piece of land that happens to be perfectly rectangular. The equation for calculating the area of a rectangle is as follows: area length × width. W is the length of smaller side of rectangleĬ Program to find the area of the rectangle When the length and width of a rectangle are equal, the shape is a special case of a rectangle, called a square. In the first step, enter the value for length and width in the Length and Width boxes. L is the length of longer side of rectangle As opposite sides of a rectangle are equal we can calculate perimeter of rectangle as follows: To find the perimeter of a rectangle, we should add the length of all four sides of rectangle. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |