Advertisement
Guest User

Untitled

a guest
Oct 24th, 2021
681
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3.  
  4. int main()
  5. {
  6. double a, b, c, d, S1, S2, x, y;
  7.  
  8. /* S1=[a,b] i S2=[c,d] */
  9.  
  10. printf("Unesite brojeve a,b,c,d: ");
  11. scanf("%lf %lf %lf %lf", &a, &b, &c, &d);
  12.  
  13. if (a<c && c<b)
  14. {
  15. if (b>d)
  16. printf("Rezultantni interval je [%g,%g].", c, d);
  17. else
  18. printf("Rezultantni interval je [%g,%g].", c, b);
  19. }
  20. else if (a>c && c<b)
  21. {
  22. if (b>d)
  23. printf("Rezultantni interval je [%g,%g].", a, d);
  24. else {
  25. printf("Rezultantni interval je [%g,%g].", a, b);
  26. }
  27. }
  28. else if (b>a && d>c)
  29. {
  30. printf("Skupovi se ne sijeku.");
  31. }
  32.  
  33.  
  34.  
  35.  
  36.  
  37. return 0;
  38. }
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement