Circumference Of Circle C++ Example Program
Definition
When a circle's diameter is 1, its circumference is π. When a circle's radius is 1—called a unit circle—its circumference is 2π.
Formula
The circumference of a circle is written
π = C / d
Or, equivalently, as the ratio of the circumference to twice the radius. The above formula can be rearranged to solve for the circumference:
C = π * d = 2π * r
here,
r = Radius π = ~3.14
Circumference Of Circle Example Program
/*## Circumference Of Circle In C++*/
/*## Calculation C++ Programs, Datatype C++ Programs, Basic C++ Programs*/
#include <iostream>
#include<conio.h>
#include<stdlib.h>
using namespace std;
float PI = 3.14;
int main() {
// Declare Variables
float radius, ci;
cout << "Simple C++ Program : Circumference Of Circle\n";
cout << "\nEnter the radius of Circle : ";
cin>>radius;
ci = 2 * PI * radius;
cout << "\nCircumference of Circle : " << ci;
getch();
return (0);
}
Sample Output
Simple C++ Program : Circumference Of Circle
Enter the radius of Circle : 5
Circumference of Circle : 31.4
C++ Common Example Programs
- Factorial Using Loop Example Program In C++
- Factorial Using Function Example Program In C++
- Factorial Using Recursion Example Program In C++
- Find Prime Number ( Method1 ) Example Program In C++
- Find Prime Number ( Method2 ) Example Program In C++
- Fibonacci series Example Program In C++
- Example Program For Multiplication Value Using For Loop In C++
- Area Of Circle Example C++ Program
- Area Of Square Example C++ Program
- Area Of Rectangle Example C++ Program
- Odd Or Even Example C++ Program
- Sum of Digits Example C++ Program
- Circumference Of Circle C++ Example Program
- Simple C++ program for print the sum of all odd numbers from 1 to n
- Simple Program for Convert Feet to Inches In C++ Programming
- Odd Or Even Example C++ Program Using function
Read More Articles
- Simple Merge Sort Program in C++
- Scope Resolution Operator In C++
- Simple Program for Virtual Functions Using C++ Programming
- Simple Class Example Program For Find Prime Number In C++
- Simple Example Program For Parameterized Constructor In C++
- Define Constructor in Outside Class Example Program In C++
- Simple Example Program For Copy Constructor In C++
- Simple Program for Function Overloading Using C++ Programming
- Simple Program for Single Inheritance Using C++ Programming
- Simple Program for Inline Function without Class Using C++ Programming
- Simple Example Program For Constructor In C++
- Factorial Using Function Example Program In C++
- Simple Addition ( Add Two Integers ) Example Program
- Simple Example Program for Inline Function Using C++ Programming
- Simple Program for Read user Input Using cin
- Simple Example Program For Constructor Overloading In C++
- Factorial Using Loop Example Program In C++
- Simple Stack Program in C++ Programming
- Simple Program for Friend Function Using C++ Programming
- Simple Program for Static Data and Member Function Using C++ Programming
- Simple Program for Unary Operator Overloading Using C++ Programming
- Do While Loop Example Program In C++
- Simple Program for Binary Operator Overloading Using C++ Programming
- Simple Program for Multiple Inheritance Using C++ Programming
- Simple Copy Constructor Example Program For Find Factorial In C++