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.
void main()
{
float l,b,r,arear,perimeterr,areac,perimeterc;
printf("\nInput the length and breadth of rectangle and radius of circle respectively");
scanf("%f%f%f",&l,&b,&r);
arear=l*b;
perimeterr=2*l+2*b;
areac=3.141592654*r*r;
perimeterc=2*3.141592654*r;
printf("\nThe area of rectangle is %f\nThe perimeter of rectangle is %f\nThe area of circle is %f\nThe circumference of the circle is %f",arear,perimeterr,areac,perimeterc);
}
Subscribe to:
Post Comments (Atom)
your blog is good
ReplyDeletei have too have a blog
http://cprograms.tk/