Sunday, 2 September 2012

WAP to enter no. of days and print the no of years,months and days

  • WAP to enter no. of days and print the no of years,months and days
#include <stdio.h>
#include <conio.h>
void main()
{
    int n,d,y,m;
    printf("Enter the number of day");
    scanf("%d",&n);
    y=n/365;
    d=n%365;
    m=d/30;
    d=d%30;
    printf("%d Year %d Month %d day",y,m,d);
    }

No comments:

Post a Comment