Advertisement
HristoBaychev

extDefPi

Oct 6th, 2021
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1.  
  2. #include <stdio.h>
  3. void g_PI();
  4. const double PI = 3.14159;
  5.  
  6. double cVerPi(double r){
  7.    
  8.     double sum = 0;
  9.     sum = PI*r*r;
  10.     printf ("\n%f", sum);
  11.     return sum;
  12. }
  13.  
  14. double secFunc(double a, double b){
  15.     double sumForSecFunc = 0;
  16.     sumForSecFunc = PI * a * b;
  17.     printf("\n%f", sumForSecFunc);
  18.     return sumForSecFunc;
  19. }
  20.  
  21. int main() {
  22.     cVerPi(1);
  23.     cVerPi(1.5);
  24.     cVerPi(13);
  25.  
  26.     secFunc(1, 1);
  27.     secFunc(2, 2);
  28.     secFunc(3, 3);
  29.  
  30.     return 0;
  31.    
  32. }
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement