From 60282cfce72aec814c1b4589cba8a75c0ef22714 Mon Sep 17 00:00:00 2001 From: BELLO Adeiza Luqman Ungwaha <50954176+ItzAboki@users.noreply.github.com> Date: Sat, 30 Oct 2021 09:56:30 +0100 Subject: [PATCH] Create Convert days into years, months, weeks --- cpp/Convert days into years, months, weeks | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 cpp/Convert days into years, months, weeks 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: "<