Computer Science, asked by jshrivastava2004, 1 month ago

Accept length and breadth of a rectangle from the user. Calculate and display the perimeter​

Answers

Answered by bakrihullisantosh
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 ADITYABHAIYT
1

Accept length and breadth of a rectangle from the user. Calculate and display the perimeter

Similar questions