C Online Compiler
Example: C Program to Convert Days into Years Weeks and Days
C
C++
C#
Java
Python
PHP
main.c
STDIN
Run
// C Program to Convert Days into Years Weeks and Days #include <stdio.h> int main() { int d, y, w; // d = days // y = years // w = weeks printf("Enter the days::\n"); scanf("%d", &d); // It will make conversion of days in to years, weeks and days y = (d / 365); w = (d % 365) / 7; d = d - ((y * 365) + (w)); // It will produce the final output printf("\n%d Year, %d Weeks, and %d Days\n", y, w, d); return 0; }
464
Output
Clear
ADVERTISEMENTS