diff --git a/cpp/Convert days into years, months, weeks b/cpp/Convert days into years, months, weeks new file mode 100644 index 0000000..560fa7c --- /dev/null +++ b/cpp/Convert days into years, months, weeks @@ -0,0 +1,20 @@ +#include + +using namespace std; +int main() +{ + int tot, days, weeks, months, years; + cout<<"Enter Total Number of Days: "; + cin>>tot; + years = tot/365; + months = (tot%365)/30; + weeks = ((tot%365)%30)/7; + days = ((tot%365)%30)%7; + + cout<<"\nYears: "<