C program to convert given number of days into years, weeks and days

Program

#include<stdio.h>
 
int main()
{
	int y,w,d,a;
	printf("Enter total number of days:");
	scanf("%d",&d);
 
	y=d/365;
	a=d%365;
	w=a/7;
	d=a%7;
	printf("\nYears=%d\nWeeks=%d\nDays=%d",y,w,d);
	
	return 0;
}

Output

DURGESH

I Love python, so I like machine learning a Lot and on the other hand, I like building apps and fun games I post blogs on my website for Tech enthusiast to learn and Share Information With The World.

Leave a Reply

Your email address will not be published. Required fields are marked *

3 × three =

Recent Content