bsc

Comprehensive codebase and cou...
Log | Files | Refs | Activity | README | LICENSE

root / semester_1 / letusc / luc002.c

luc002.c (812B)


      1 /* The length and breadth of a rectangle and radius of a circle
      2 are input through the keyboard. Write a program to calculate the
      3 area and perimeter of the rectangle, and the area and circumference
      4 of the circle. */
      5 /* Let Us C; Page - 19; Chap- 1; QNo.: F(b) */
      6 
      7 #include <stdio.h>
      8 #include <math.h>
      9 int main()
     10 {
     11 	double len, bre, r, area_r, per, area_c, cir;
     12 	printf("Enter the length and breadth of the rectangle : ");
     13 	scanf("%lf %lf", &len, &bre);
     14 	printf("Enter the Radius of the circle : ");
     15 	scanf("%lf", &r);
     16 	area_r = len * bre;
     17 	per = 2 * (len + bre);
     18 	area_c = M_PI * r * r;
     19 	cir = 2 * M_PI * r;
     20 	printf("\nArea of Rectangle       : %lf"
     21 		   "\nPerimeter of Rectangle  : %lf"
     22 		   "\nArea of Circle          : %lf"
     23 		   "\nCircumference of Circle : %lf",
     24 		   area_r, per, area_c, cir);
     25 	return 0;
     26 }
© notamitgamer • Site Built: 2026-09-05 01:53:16 UTC • git-mirror commit: c170d72 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror