Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- double const PI = 3.14; // Global variable
- double areaCircle (int r){
- double area = PI * r * r;
- std::cout << "Circle Area=" << area << std::endl;
- return area;
- }
- double perimeterCircle (int r){
- double perimeter = PI * 2 * r;
- std::cout << "Circle perimeter=" << perimeter << std::endl;
- return perimeter;
- }
- int main()
- {
- unsigned double r;
- cout << "Enter radius ";
- cin >> r ;
- areaCircle(r);
- perimeterCircle(r);
- return 0;
- }
- //A = π r²
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement