# Write the solution to the following problem in PascalABC: find the area of a ring bounded by two circles.

July 28, 2021 | education

| **Write the solution to the following problem in PascalABC: find the area of a ring bounded by two circles. The radii are arbitrary.**

Var r1, r2, area1, area2, area: real;

begin

// enter the required characteristics

Write (‘Enter the radius of the first circle:’); Readln (r1);

Write (‘Enter the radius of the second circle:’); Readln (r2);

// area of the first circle

area1: = pi * r1 * r1;

// area of the second circle

area2: = pi * r2 * r2;

// ring area

If area1> = area2 then area: = area1-area2 else area: = area2-area1;

Writeln (‘The area of the ring is equal to’, area);

end.

One of the components of a person's success in our time is receiving modern high-quality education, mastering the knowledge, skills and abilities necessary for life in society. A person today needs to study almost all his life, mastering everything new and new, acquiring the necessary professional qualities.