Machine Problem 

Write a program to ask the user to give an input number of days and convert it to years, weeks, and days and display the result on the screen.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following,, and

My mobile number here in the Philippines is 09173084360.

Please subscribe to my channel


Want to support my channel?

GCash Account

Jake Pomperada




Thank you very much for your support

Program Listing

/* days.c
Convert days to years weeks and days
Author   : Jake Rodriguez Pomperada, MAED-IT, MIT
Website  : and
Email    :
Tool     : Dev C++ Version 5.11
Date     : April 18, 2022  5:51 AM  Monday

#include <stdio.h>

int main()
   int days=0, years=0, weeks=0;

   system("COLOR F0");
   printf("\tConvert Days to Years, Weeks and Days in C");
   printf("\tHow Many Days : ");
   scanf("%d", &days);

    /* Conversion in this portion */
    years = (days / 365);   /* Ignoring leap year */
    weeks = (days % 365) / 7;
    days  = days - ((years * 365) + (weeks * 7));

    printf("\tDisplay Results");
    printf("\tNumber of Years : %d\n", years);
    printf("\tNumber of Weeks : %d\n", weeks);
    printf("\tNumber of Days  : %d", days);
    printf("\tEND OF PROGRAM");