#include <iostream>
using namespace std;
int main()
{
float r_in, r_outer,inner_area,outer_area,shaded_area;
/* Calculation of area of the inner circle*/
cout << "Enter the radius of the innter circle: ";
cin >> r_in;
inner_area=3.13*r_in*r_in;
cout << "Area of the innter circle: "<< inner_area << endl;
/* Calculation of area of the outer circle*/
cout << "Enter the radius of the outer circle: ";
cin >> r_outer;
outer_area=3.13*r_outer*r_outer;
cout << "Area of the outer circle: "<< outer_area << endl;
/* calculation of the area of the shaded region */
shaded_area=outer_area-inner_area;
cout << "Area of the shaded region of the circle: "<< shaded_area << endl;
return 0;
}
Comments
Leave a comment