#include <stdio.h>
int main(void)
{
unsigned int year, month, day;
unsigned int dateChoice;
printf("Input year:");
scanf("%u", &year);
do{
printf("Input month(as number):");
scanf("%u", &month);
} while (month < 1 || month > 12);
do{
printf("Input day(as number):");
scanf("%u", &day);
} while (day < 1 || day > 31);
do {
printf("Input display type. Enter 1 for day/month/year, enter 2 for dd/mm/yy:\n");
scanf("%u", &dateChoice);
} while (dateChoice != 1 && dateChoice != 2);
if (dateChoice == 1) printf("Your choice is day/month/year.\n");
else printf("Your choice is dd/mm/yy.\n");
printf("The date is: ");
if (dateChoice == 1) {
printf("%u/%u/%u\n", day, month, year);
}
else {
printf("%02u/%02u/%02u\n", day, month, (year % 100));
}
return 0;
}