Advertisement
Guest User

Untitled

a guest
Dec 12th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <iostream>
  2.  
  3.  
  4. using namespace std;
  5.  
  6. double pi = 3.1415;
  7.  
  8. void printa(double r);
  9. int main()
  10. {
  11.  
  12. double r, p;
  13. cout<< "Enter the radius: ";
  14. cin>> r;
  15. cout<< "Enter the value of pi: ";
  16. cin>> p;
  17. cout<< "The area calculated in main: "<< (p*r*r)<<endl;
  18.  
  19. cout<< "The area calculatd in function: ";
  20. printa( r);
  21.  
  22. return 0;
  23. }
  24.  
  25. void printa(double r){
  26. cout<< pi*r*r;
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement