C Program to accept number of days and print year, month and remaining days


/* C program to accept number of days and print year, month and remaining days. */

#include"stdio.h"

void main()
{

int days, yrs, mnths, rdays;
printf("Enter the number of days: ");
scanf("%d", &days);
yrs = days / 360;
days = days % 360;
mnths = days / 30;
rdays = days % 30;
printf("The number of year/s is %d \nnumber of month/s is %d \nnumber of remaining day/s is %d", yrs, mnths, rdays);
printf("\n");

}


Output:

Comments

Popular Posts