Advertisement
Guest User

Prog

a guest
Dec 7th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4. //napisati funkciju za izracunavanje hipotenuze trougla ako su date katete a i b
  5. float hipotenuza (float a, float b){
  6. return sqrt(pow(a,2)+pow(b,2));}
  7. int main()
  8. { float c, a, b;
  9. printf("unesi stranice a i b\n");
  10. scanf("%f%f",&a,&b);
  11. c=hipotenuza(a,b);
  12.  
  13. printf("%.2f\n",c);
  14. return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement