//Program
#include<stdio.h>
void main()
{
clrscr();
int tdays, years, weeks, days, num1;
prinf("Enter total number of days:");
scanf("%d",&tdays);
years = tdays / 365;
num1 = tdays % 365;
weeks = num1 / 7;
days = num1 % 7;
printf("\n Years = %d ", years);
printf("\n Weeks =%d ", weeks);
printf('\n Days=%d ", days);
getch( );
}
Output:
Enter total number of days:365
Year = 1
Weeks = 52
Days = 365
#include<stdio.h>
void main()
{
clrscr();
int tdays, years, weeks, days, num1;
prinf("Enter total number of days:");
scanf("%d",&tdays);
years = tdays / 365;
num1 = tdays % 365;
weeks = num1 / 7;
days = num1 % 7;
printf("\n Years = %d ", years);
printf("\n Weeks =%d ", weeks);
printf('\n Days=%d ", days);
getch( );
}
Output:
Enter total number of days:365
Year = 1
Weeks = 52
Days = 365
No comments:
Post a Comment