The length and breadth of a rectangle and radius of a circle are input through the keyboard. write a program to calculate the area and perimeter of the rectangle, and the area and circumference of the circle #include<stdio.h> # include<conio.h> int main(){ float l,b,r, ca,cc,ra ,rp; printf("Enter the length of rectangle:"); scanf("%f",&l); printf("Enter the breadth of rectangle:"); scanf("%f",&b); printf("Enter the radius of circle:"); scanf("%f",&r); ra=l*b; rp=2*(l+b); ca=3.14*r*r; cc=2*3.14*r; printf("\nThe area of rectangle :%0.2f", ra); printf("\n The perimeter of rectangle : %.2f ,rp); printf("\nThe area of circle:%2f:",ca); printf("\n The circumference of circle:%.2f",cc); return 0; } output- -- Enter the length of rectangle:3 Enter the breadth of rectangle:5 ...
Comments
Post a Comment