Tuesday, May 25, 2010

Program to convert Days to Months (30 days) and days

/*
* Program to convert Days to Months (30 days) and days.c
*
* Created on: May 25, 2010
* Author: Karthikeyan
*/

# include <stdio.h>
# include <stdlib.h>

int main()
{
int months,days;
printf("Enter days\n");
scanf("%d",&days);
months = days / 30;
days = days % 30;
printf("Months = %d \n Days = %d",months,days);
return 0;
}


OUTPUT:


Enter days 365
Months = 12
Days = 5

No comments:

Post a Comment