Advertisement
Guest User

Zadanie 1

a guest
Jan 26th, 2015
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. float x, y, z;
  4.  
  5. float srednia(float a, float b, float c)
  6. {
  7.         float s;
  8.         s = ((a+b+c)/3);  
  9.         return s;
  10. }
  11.  
  12. int main()
  13. {
  14.        printf("Podaj liczbe x: ");
  15.        scanf("%f", &x);
  16.        printf("Podaj liczbe y: ");
  17.        scanf("%f", &y);
  18.        printf("Podaj liczbe z: ");
  19.        scanf("%f", &z);
  20.        
  21.        printf("\nSrednia to: %.2f\n", srednia(x, y, z));
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement