This C++ program calculates and prints the area and circumference of a circle for a given radius.
- Prompts the user to enter the radius
r - Initializes
p = 3.14(approximate value of ฯ) - Calculates:
- Area
a = ฯ * rยฒ - Circumference
c = 2 * ฯ * r
- Area
- Prints both the area and circumference
- Uses
clrscr()to clear the screen andgetch()to pause output (Turbo C++ specific)
enter radius of circle:5
area of circle is:78.5
circumference of circle is:31.4
- Open Turbo C++ IDE
- Go to File > Open, select
ARCIRC.CPP - Compile > Run
- Input using
cin - Arithmetic calculations
- Using
pow()function - Basic console output in C++