Thursday, May 12, 2016

Convert Number Of Days To Number Of Years, Weeks and Days





 #include <stdio.h>
 #define DAYSINWEEK 7

 void main()
 {
    int number_days, year, week, days;

    printf("Enter Number Of Days :\n");
    scanf("%d",&number_days);

    year = number_days/365;
    week = (number_days % 365)/DAYSINWEEK;
    days = (number_days%365) % DAYSINWEEK;

    printf ("%d Days Is equivalent To %d Years, %d Weeks And %d Days\n",
     number_days, year, week, days);
 }




Share this

0 Comment to "Convert Number Of Days To Number Of Years, Weeks and Days"

Post a Comment