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. - Code With Friends

Breaking

Home Top Ad

Search Your Questions

Thursday, February 21, 2019

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.

#include<stdio.h>
int main()
{
    int length,breadth,r;
    float area, perimeter, areac,cc;

    printf("Enter the Length and Breadth and radius ");
    scanf("%d %d %d", &length,&breadth,&r);

    perimeter = 2*(length+breadth);
    area = length*breadth;
    cc = 2*(22/7)*r;
    areac = (22/7)*r*r;

    printf("The area of rectangle is %f\n",area);
    printf("The area of circle is %d\n",areac);
    printf("The circumference of circle is %f\n",cc);

}








No comments:

Post a Comment