At last, it prints the perimeter of rectangle on screen using printf function. 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. Use this calculator to find the square footage, square inches, square yardage, square meters or acres for a building, home, garden or construction project. Doing this provides a safety net, guaranteeing that you have sufficient room to. At last, it prints the area of rectangle on screen using printf function. Calculate the CBM volume of a space or capacity of an object in cubic. 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. W is the length of smaller side of rectangleĬ Program to find the area of the rectangle 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. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |