How to write a C progeramme for calculating area of two concentric circles?
Answers
Answered by
1
Explanation:
#include<stdio.h>
#include<conio.h>
#define pi 3.14
void main()
{
float r1,r2,a1,a2,area;
printf("enter the radius of large circle");
printf("%f",&r1);
printf("enter radius of small circle");
scanf("%f",&r2);
a1=pi*r1*r1;
a2=pi*r2*r2;
area=a1-a2;
printf("the area of the first circle is :%.2f",a1);
printf("\n the area of second circle is:%.2f",a2);
printf("\n the area between two circles is:%.2f",area);
getch();
}
Similar questions