Advertisement
Rehan_Rahman26

Function Problem 01

Oct 7th, 2021
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. float area(float radius_circle);
  5. float area(float radius_circle)
  6. {
  7. float area_circle;
  8. area_circle = 3.14 * radius_circle * radius_circle;
  9.  
  10. return area_circle; //return area
  11. }
  12.  
  13. int main() {
  14. float r;
  15.  
  16. cin >> r;
  17.  
  18. cout << "Area of circle: " << area(r) << endl;
  19.  
  20. return 0;
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement