Advertisement
Guest User

zad3

a guest
Dec 17th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int *f(float a, float b,int *c)
  5. {
  6. *c=(int)b - (int)a;
  7. if(*c>0)
  8. return (int *)malloc(*c *sizeof(int));
  9. return NULL;
  10. }
  11.  
  12.  
  13.  
  14. int main()
  15. {
  16. int rezultat;
  17. float a,b;
  18. // a=2,65;
  19. // b=3,5;
  20. scanf("<%f;%f>",&a,&b);
  21. int *tab=f(a,b,&rezultat);
  22. if(tab!=NULL)
  23. printf("%d\n",rezultat);
  24. return 0;
  25.  
  26.  
  27.  
  28. printf("Hello world!\n");
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement