Write a program to find the area of rectangle

#include<stdio.h>
#include<conio.h>
void main()
{
    int l, b, r, ar,cr, ac,cc ;
    printf("Enter the length of rectangle: ");
    scanf("\n%d",&l);
    printf("Enter the width of rectangle: ");
    scanf("\n%d",&b);
    printf("\nEnter the radius");
    scanf("\n%d",&r);
   
    ar=l*b;
    cr=2*(l+b);
    printf("\nArea of rectangle is: ");
    printf("\n%d",ar);
    printf("\nCircumference of rectangle is: ");
    printf("\n%d",cr);
   
    ac=3.14*r*r;
    cc=2*3.14*r;
    printf("\nArea of cicle is: ");
    printf("\n%d",ac);
    printf("\nCircumference of cicle is: ");
    printf("\n%d",cc);
    getch();
}



Sample Output:


Post a Comment

Previous Post Next Post