write a simple c++ program to compute the area of a circle
#include <iostream>
double calculateCircleArea(double radius, double pi = 3.14) {
return radius * radius * pi;
}
int main() {
std::cout << "Enter radius: ";
double radius = 0;
std::cin >> radius;
std::cout << "Area: " << calculateCircleArea(radius);
return 0;
}
Comments
Leave a comment