Accept length and breadth of a rectangle from the user. Calculate and display the perimeter
Answers
Answered by
1
Answer:
/* C program to find the perimeter of a rectangle */
#include <stdio.h>
int main()
{
float l, w, p;
printf("Enter the length & width of the rectangle::\n");
scanf("%f", &l);
scanf("%f", &w);
/* Calculate perimeter of rectangle */
p = 2 * (l + w);
/* Print output */
printf("\nThe Perimeter of rectangle = %f units ", p);
return 0;
}
Explanation:
in addition you can calculate the perimeter with same program
in case if you dont need perimeter then you remove the perimeter function
Answered by
1
Accept length and breadth of a rectangle from the user. Calculate and display the perimeter
Similar questions