# Write a C program to calculate the area & perimeter of the rectangle, and the area & circumference of the circle

**Problem Statement:**

The length & breadth of a rectangle and radius of a circle are input through the keyboard. Write a program to calculate the area & perimeter of the rectangle, and the area & circumference of the circle.

**Answer:**

**/* Calculation of perimeter and area of rectangle and circle */**

#include<stdio.h>

#include<conio.h>

main()

{

int l, b, r, area1, perimeter;

float area2, circum;

clrscr();

printf(“\n Enter Length and Breadth of Rectangle”);

scanf(“%d %d”,&l, &b);

area1=l*b; /*Area of rectangle */

perimeter=2*l+2*b; /* Perimeter of rectangle */

printf(“\n Area of Rectangle = %d”, area1);

printf(“\n Perimeter of Rectangle=%d”,perimeter);

Print(“\n\n Enter Radius of circle”);

scanf(“%d”,&r);

area2=3.14*r*r; /* Area of Circle */

circum=2*3.14*4; /* Circumference of a circle */\

printf(“Area of Circle=%f”,area2);

printf(“Circumference of Circle-%f”,circum);

printf(“\n\n\n\n Press any key to exit….”);

getch();

}

## Related Posts

- 42Problem Statement: The distance between two cities (in km.) is input through the keyboard. Write a C program to convert and print this distance in meters, feet, inches and centimeters. Answer: /* Conversion of distance */ #include <stdio.h> #include <conio.h> main() { float km, m, cm, ft, inch; clrscr(); /*…
- 41
- 36
- 34
- 33This program is written in C Language using graphics. This will show day, month, date, current time and year as output. #include <graphics.h> #include <time.h> // driver code int main() { // DETECT is a macro defined in // "graphics.h" header file int dt = DETECT, gmode, midx, midy; long current_time;…