Tux Education Our New Education Channel Please Share And Subscribe It...

/* Program To Convert Days To YEAR, WEEKS & DAYS */

// Compiler : Dev-C++ 4.9.9.2

#include<stdio.h>
#define DAYSINWEEK 7

int main()
{
    int ndays,year,week,days;
    
    printf("Days : ");
    scanf("%d",&ndays);
    
    year=ndays/365;
    week=(ndays%365)/DAYSINWEEK;
    days=(ndays%365)%DAYSINWEEK;
    
    printf("\n\n%d Days Is Equivalent To %d Years, %d Weeks & %d Days.",ndays,year,week,days);
    
    getch();
    return 0;
}

Post a Comment