Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- double a, b, c, d, S1, S2, x, y;
- /* S1=[a,b] i S2=[c,d] */
- printf("Unesite brojeve a,b,c,d: ");
- scanf("%lf %lf %lf %lf", &a, &b, &c, &d);
- if (a<c && c<b)
- {
- if (b>d)
- printf("Rezultantni interval je [%g,%g].", c, d);
- else
- printf("Rezultantni interval je [%g,%g].", c, b);
- }
- else if (a>c && c<b)
- {
- if (b>d)
- printf("Rezultantni interval je [%g,%g].", a, d);
- else {
- printf("Rezultantni interval je [%g,%g].", a, b);
- }
- }
- else if (b>a && d>c)
- {
- printf("Skupovi se ne sijeku.");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement