/* * Author : Amit Dutta * Date : 08 Feb 2026 * Repo : https://github.com/notamitgamer/bsc * License : MIT License (See the LICENSE file for details) */ /* Define a function that compares two given dates. Return 0 if equal, otherwise return 1. */ /* Let Us C, Chap- 17 (Structures), Qn No.: B(g) */ /* This file is auto-generated by a bot. */ /* This code is not compiled; it is for reference only. */ #include #include #include struct date { int day; int month; int year; }; int compare_dates(struct date d1, struct date d2); int main() { struct date date1, date2; printf("Enter Date 1 (dd mm yyyy): "); scanf("%d %d %d", &date1.day, &date1.month, &date1.year); printf("Enter Date 2 (dd mm yyyy): "); scanf("%d %d %d", &date2.day, &date2.month, &date2.year); if (compare_dates(date1, date2) == 0) printf("The dates are Equal.\n"); else printf("The dates are NOT Equal.\n"); return 0; } int compare_dates(struct date d1, struct date d2) { if (d1.day == d2.day && d1.month == d2.month && d1.year == d2.year) return 0; else return 1; }