C Program of Fencing the Ground
The college's ground is rectangular. Fencing the ground the management makes the decision to construct a fence around the ground. They planned to wrap a thick rope around the ground to assist the construction workers in constructing a straight fence. They wanted to purchase only the required length of rope. During the rainy season, they also wanted to carpet the entire ground. They wanted to purchase only the required quantity of carpet. They mentioned your assistance.
Could you please write a C program to determine the exact length of the rope and the quantity of caper required to assist them?
Type of Input:
Two integers constitute the input. The width and length of the ground are represented by the first and second integers, respectively.
Type of Output:
For precise formatting requirements, see Sample Input and Output.
An example of input and output:
[All text in striking relates to enter and the rest compares to output]
Enter the length of the ground
50
Enter the width of the ground
20
The length of the rope required is 140m
The amount of rug required is 1000sqm
#include<stdio.h>
int main(){
int l,w;
printf("Enter the length of the ground\n");
scanf("%d",&l);
printf("Enter the width of the ground\n");
scanf("%d",&w);
printf("The length of the rope needed is %dm",(2*l)+(2*w));
printf("\nThe quantity of carpet needed is %dsqm",l*w);
return 0;
}