Write a Program to find out given no of days to year,months and day format


/* This program is to find out given no of days to year,months and day format*/

#include<stdio.h>

#define month 30

main()
{
int a,temp,y,m,d;
printf("Enter days to be converted \n");
scanf("%d",&a);
temp=a;
y=a/365;
m=(a%365)/month;
d=(a%365)%month;

printf("No of days input %d \n",temp);
printf("Converted to %d years , %d moths and %d days \n",y,m,d);

}




/*
INPUT:
Enter days to be converted
897
OUTPUT:
No of days input 897
Converted to 2 years , 5 moths and 17 days
*/

Comments