C++ Program to Find the Area and Circumference of a Circle

 C++ Program to Find the Area and Circumference of a Circle



I'll show you how to use C++ to find the area and circumference of a circle in this post. One of the most fundamental geometric shapes is the circle, and understanding how to calculate its properties is an excellent way to comprehend formulas and how to use them in programming.


Basic: 

✔ Area = π * r² 

✔✔ Circumference = 2 * π * r                                                                                                                                                                            



Code:



#include <iostream>

using namespace std;

int main(){

const float pi=3.14;

int radius;

float area;

float cir;

cout<<"***Area and Cirmference of Circle****"<<endl;

cout<<"Enter Radius of Circle"<<endl;

cin>>radius;

cout<<"your Area:"<<endl;

area=pi*radius*radius;

cout<<area;

cout<<endl<<"Your Cirmfrence is:"<<endl;

cir=2*pi*radius;

cout<<cir;

return 0;

}



Out Put




THANKS.....






Comments

Popular posts from this blog

Instagram Data Breach Allegations (January 2026): A Technical Analysis from a Cybersecurity Perspective

Arduino Based Fire Fighting Robot

Master Your Finances: C++ Program to Calculate Monthly Expenses!