+ 1

I wrote this code but there is something wrong with the output of months and days

https://code.sololearn.com/ctEmg8uUZ6VJ/?ref=app

19th Dec 2017, 5:38 PM
Mohammed Mahil
Mohammed Mahil - avatar
2 Respuestas
+ 6
#include <iostream> using namespace std; int main () { int year ,month , day ; cin>> year>> month>> day ; int a=2017 ,b = 12 ,c = 19 ; cout << a-year << " years"<< endl; cout << b-month << " month"<< endl; if (day <19){ cout << 19-day << endl; } else { cout <<31-day << endl; } return 0; } do like this you miss at this place cin>> year>> month>> day ;
19th Dec 2017, 5:46 PM
GAWEN STEASY
GAWEN STEASY - avatar
+ 1
yeah it worked ! thanks alllot
19th Dec 2017, 6:38 PM
Mohammed Mahil
Mohammed Mahil - avatar