+ 1

Can you solve write a program in c++to print area of circle

18th Nov 2016, 11:22 AM
Aniket Deshmukh
3 Respostas
+ 2
#include<iostream.h> #include<conio.h> main() { int r; float ar; cout<<"Enter radius : "; cin>>r; ar=(22/7.0)*r*r; cout<<"\nArea of circle = "<<ar; getch(); }
18th Nov 2016, 12:56 PM
Manthan
Manthan - avatar
+ 2
#include<iostream> using namespace std; int main() { float r , area ; cin >> r ; cout << " Radius = " << r ; area = (22/7.0)*r*r ; cout << "\n Area = " << area ; return 0; }
4th May 2017, 8:05 AM
khandavilli sai sri rama
khandavilli sai sri rama - avatar
0
For C++11: constexpr double pi() { return std::atan(1) * 4; } double circleArea(double radius) { return pi() * radius * radius; }
18th Nov 2016, 11:36 AM
Arthur Busser
Arthur Busser - avatar