Write a Program that accept length,breadth and radius of a rectangle and circle and
display Area,perimeter of a rectangle and circumference of circle
#include <stdio.h>
#include <conio.h>
void main()
{
int a1,p,a2,c,l,b,r;
clrscr();
printf("Enter length,breadth and radius");
scanf("%d%d%d",&l,&b,&r);
a1=l*b;
p=2*(l+b);
display Area,perimeter of a rectangle and circumference of circle
#include <stdio.h>
#include <conio.h>
void main()
{
int a1,p,a2,c,l,b,r;
clrscr();
printf("Enter length,breadth and radius");
scanf("%d%d%d",&l,&b,&r);
a1=l*b;
p=2*(l+b);
a2=3.14*r*r;
c=2*3.14*r;
printf("\nArea and Perimeter of a rectangle is %d and %d",a1,p);
printf("\nArea and circumference of a circle is %d and %d",a2,c);
getch();
}
c=2*3.14*r;
printf("\nArea and Perimeter of a rectangle is %d and %d",a1,p);
printf("\nArea and circumference of a circle is %d and %d",a2,c);
getch();
}
#include
ReplyDeleteint main()
{
float r;
printf("\n Enter the radius to calculate the area of circle ");
scanf("%f",&r);
printf("\n Area of circle : %f ", 3.14159265358979*r*r);
printf("\n Perimeter of the circle : %f ", 2*3.14159265358979*r);
system("pause");
}