Booka is an alien. He couldn't understand how to measure days, weeks, months and years. Make Booka understand what is meant by days, weeks, months and years. Teach him about the conversion of days into years, months and weeks using a program. INPUT FORMAT: Input consists of an integer which corresponds to the number of days. OUTPUT FORMAT: The output consists of three integers. The first integer corresponds to the total years. The second integer corresponds to the total weeks. The third integer corresponds to the total days.
SAMPLE INPUT: 373
Answers
Answered by
1
Answer:
#include<stdio.h>
int main()
{
int days, years, weeks, months;
printf("Enter Days:");
scanf("%d",&days);
years=days/365;
weeks=days/7;
months=days/30;
printf("Days to years %d",years);
printf("\nDays to weeks %d",weeks);
printf("\nDays to months %d",months);
}
Answered by
0
Answer:
Explanation: in c
#include<stdio.h>
int main()
{
//fill the code
int num,years,weeks,days;
scanf("%d",&num);
years = num / 365;
num = num - (years * 365);
weeks = num / 7;
days = num - (weeks * 7);
printf("%d\n%d\n%d",years,weeks,days);
return 0;
}
Similar questions