The length and width 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 a circle.


#include<stdio.h> void main() { float length,width,radius,area_of_R,peri_m,area_of_C,circum_; printf("Enter length of rectangl = "); scanf(" \n %f",&length); printf("Enter width of rectangl = "); scanf(" \n %f",&width); area_of_R=length*width; printf("\n Area of rectangle = %f",area_of_R); peri_m=2*(length+width); printf("\n Perimeter of rectangle = %f",peri_m); printf("\n Enter length of radius = "); scanf("%f",&radius); area_of_C=22*radius*radius/7; printf("\n Area of circle = %f",area_of_C); circum_=22*2*radius/7; printf("\n Circumference of circle = %f",circum_); }

Post a Comment (0)
Previous Post Next Post