move to repo.or.cz
[letusc.git] / ch1 / exercises / ex5.c
blob8baaf8259fb59a44b516445dfd24abf9e1a41ef9
1 /*area of circle and rectangle*/
3 #include<stdio.h>
5 int main()
7 float len,bre,rad;
8 float area_rect,area_circle;
9 float perimeter,cir_circle;
10 printf("Enter the len and bre of rectangle: ");
11 scanf("%f %f",&len,&bre);
12 printf("Enter the radius of the circle: ");
13 scanf("%f",&rad);
15 area_rect = len*bre;
16 area_circle = 3.14*rad*rad;
18 perimeter = 2*(len+bre);
19 cir_circle = 2*3.14*rad;
21 printf("Area of Rectangle=%.2f perimeter=%.2f\n",area_rect,perimeter);
22 printf("Area of circle=%.2f cir_cirle=%.2f\n",area_circle,cir_circle);
24 return 0;