File: Stare vježbe/vjezbe06/36a__prototip.c

  1. /*
  2.   36a__prototip_a.c
  3.   Prototip funkcije.
  4. */
  5.  
  6. #include <stdio.h>
  7.  
  8. int f ( double );
  9.  
  10. int main()
  11. {
  12. float x=2.0;
  13.  
  14. printf ("%d\n", f(2)); /* pozivamo funkciju sa int-om kao parametrom */
  15. printf ("%d\n", f(x)); /* pozivamo funkciju sa float-om kao parametrom */
  16.  
  17. return 0;
  18. }
  19.  
  20.  
  21. int f ( double x )
  22. {
  23. return (int) (x*x);
  24. }
  25.