Wednesday, October 5, 2016

C Tutorial 8- Calculate year, months and days

#include<stdio.h>
main()
{
    int years,month,days;
    printf("Enter days so that greater than 365 days:");
    scanf("%d",&days);
    years=days/365;
    printf("%d years %d months %d days \n\n\n\n ",(days/365),((days%365)/30),((days%365)%30));
}
Output



No comments:

Post a Comment