Convert Days into Years, Months and Weeks in C || Arithmetic operations || C programming
In this program, we are going to Convert Days into Years, Months and Weeks in C Programming Language.

 
#include <stdio.h>

int main()
{
    int days, years, weeks, months;
    printf("Enter Days: ");
    scanf("%d", &days);

    years = days / 365;
    weeks = days / 7;
    months = days / 30;

    printf("Days to years: %d", years);
    printf("\nDays to weeks: %d", weeks);
    printf("\nDays to months: %d", months);
}

#ENJOY CODING

Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post