Machine Problem 

Write a program to ask the user to give 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 at 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.

Program Listing

/* days.c
Convert days to years weeks and days
Author   : Jake R. Pomperada, MAED-IT, MIT
Bacolod City, Negros Occidental Philippines

#include <stdio.h>

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

   system("COLOR F0");
   printf("\tConvert Days to Years, Weeks and Days");
   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");

Leave a Reply

Your email address will not be published. Required fields are marked *