C++ program to calculate the area and circumference of a circle
kw.cpp
#include<iostream>usingnamespacestd;#define PI 3.141592654
intmain(){floatR;cout<<"———————————————————————————————————————————";cout<<"\nProgram to calculate the area and circumference of a circle";cout<<"\n———————————————————————————————————————————";cout<<"\nEnter the radius of a circle ";cin>>R;cout<<"\nThe area of a circle is "<<PI*R*R;cout<<"\nThe circumference of a circle is "<<2*PI*R;cout<<"\n———————————————————————————————————————————\n";return0;}
Output
kodingwindow@kw:~$ g++ kw.cpp kodingwindow@kw:~$ ./a.out
———————————————————————————————————————————
Program to calculate the area and circumference of a circle
———————————————————————————————————————————
Enter the radius of a circle 10
The area of a circle is 314.159
The circumference of a circle is 62.8319
———————————————————————————————————————————
kodingwindow@kw:~$
Dear User, Thank you for visitng KodingWindow. If you are interested in technical articles, latest technologies, and our journey further, please follow us on LinkedIn.