#include #include int main () { double a1, b1, c1, d1; double a2, b2, c2, d2; double t; printf("Enter the values for the first rectangle : "); scanf("%lf%lf%lf%lf", &a1, &b1, &c1, &d1); printf("%lf %lf %lf %lf\n", a1, b1, c1, d1); printf("Enter the values for the second rectangle : "); scanf("%lf%lf%lf%lf", &a2, &b2, &c2, &d2); printf("%lf %lf %lf %lf\n", a2, b2, c2, d2); if (a1 > c1) { t = a1; a1 = c1; c1 = t; } if (b1 > d1) { t = b1; b1 = d1; d1 = t; } if (a2 > c2) { t = a2; a2 = c2; c2 = t; } if (b2 > d2) { t = b2; b2 = d2; d2 = t; } if ((a1 <= c2) && (a2 <= c1) && (b1 <= d2) && (b2 <= d1)) printf("The two rectangles intersect...\n"); else printf("The two rectangle do not intersect...\n"); exit(0); }