Area and Parameter

 TO FIND AREA AND PARAMETER / CIRCUMFERENCE OF RECTANGLE AND CIRCLE

#include<stdio.h>
#include<conio.h>
void main()
{
    int l,b,r;
    float a,p,t,g;
    printf("enter the length and breadth \n=");
    scanf("%d%d",&l,&b);
    printf("enter the radius = ");
    scanf("%d",&r);
    {
        a=(l*b) ;
        p=2*(l+b);
        g=3.14*r*r;
        t=2*3.14*r;
    }
    {
        printf("\n rectangle area =%f",a);
    }
    {
        printf("\n rectangle parameter = %f",p);
    }
    {
        printf("\n circle area = %f",g);
    }
    {
        printf("\n circle parameter = %f",t);
    }
    getch();
}

OUTPUT  :
enter the length and breadth
=5
6
enter the radius = 7

 rectangle area =30.000000
 rectangle parameter = 22.000000
 circle area = 153.860001
 circle parameter = 43.959999


Comments