#include <stdio.h>
int nextDate(int n, int d) { return (n + d) % 31; }
int main()
{
int date, month, year;
char vaccine;
printf("Enter the Day of the first dose of vaccination: ");
scanf("%d", &date);
printf("Enter the Month of the first dose of vaccination: ");
scanf("%d", &month);
printf("Enter the Year of the first dose of vaccination: ");
scanf("%d", &year);
printf("Enter the vaccination Name: ");
scanf("%s", &vaccine);
switch(vaccine) {
case 'F': {
printf("Next date of vaccine: %d %d %d", nextDate(date, 24), month, year);
break;
}
case 'M': {
printf("Next date of vaccine: %d %d %d", nextDate(date, 25), month, year);
break;
}
case 'S': {
printf("Next date of vaccine: %d %d %d", nextDate(date, 15), month, year);
break;
}
case 'V': {
printf("Next date of vaccine: %d %d %d", nextDate(date, 18), month, year);
break;
}
case 'P': {
printf("Next date of vaccine: %d %d %d", nextDate(date, 21), month, year);
break;
}
case 'S': {
printf("Not Required");
break;
}
default: {
printf("Invalid type of vaccine!!!");
break;
}
}
return 0;
}
Comments
Leave a comment