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.


 /*Program to calculate area and perimeter of rectangle, area and circumfrencce of circle

  Author:Blogspot Date: October 1, 2020*/


#include<stdio.h>

#include<conio.h>


main()

  {

     int length,breadth,area_of_rectangle, perimeter_of_rectangle,;

     float radius, area_of_circle, circumfrencce_of_circle;

     clrscr();

     printf("Enter the length of rectangle:");

     scanf("%d",&length);

     printf("Enter the breadth of rectangle:");

     scanf("%d",&breadth);

     printf("Enter the radius of circle:");

     scanf("%f",&radius);

     area_of_rectangle= length*breadth;

     perimeter_of_rectangle=(length+breadth)*2.0;

     area_of_circle= (radius*radius)*22.0/7.0;

     circumfrencce_of_circle= radius*2.0*22.0/7.0;

     printf("\narea_of_rectangle=%d",area_of_rectangle);

     printf("\nperimeter_of_rectangle=%d",perimeter_of_rectangle);

     printf("\narea_of_circle=%f",area_of_circle);

     printf("\ncircumfrencce_of_circle=%f",circumfrencce_of_circle);

     getch();

     return(0);

  }

Comments