Advertisement
Guest User

Untitled

a guest
Nov 18th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. void walec(float r, float H, float *V, float *Ppc)
  5. {
  6.     float pi == 3.14;
  7.    
  8.     *V = pi * r*r * H;
  9.     *Ppc = (2 * pi * r*r) + (2 * pi * r * H);
  10. }
  11.  
  12. int main()
  13. {
  14.     float r, H, V, Ppc;
  15.    
  16.     printf("Wprowadz promien 'r': ");
  17.     scanf("%f", &r);
  18.  
  19.     printf("Wprowadz wysokosc 'H': ");
  20.     scanf("%f", &H);
  21.    
  22.     walec(r, H, &V, &Ppc);
  23.  
  24.     printf("Promien r: %.2f\n Wysokosc H: %.2f\n Objetosc V: %.2f\n Pole pow. calk: %.2f\n", r, H, V, Ppc);
  25.  
  26.     system("PAUSE");
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement