দিনকে বছর, মাস ও দিনে রূপান্তরের সি প্রোগ্রামিং
#include <stdio.h>
int main()
{
int days, years, weeks;
printf("Enter days: ");
scanf("%d", &days);
years = (days / 365); // Ignoring leap year
weeks = (days % 365) / 7;
days = days - ((years * 365) + (weeks * 7));
printf("YEARS: %d\n", years);
printf("WEEKS: %d\n", weeks);
printf("DAYS: %d", days);
return 0;
}
Output:
Enter days: 373
YEARS: 1
WEEKS: 1
No comments