CharChar Posted March 29, 2016 Posted March 29, 2016 fix plz #include <iostream> using namespace std; int dateToNumber (int day, int month) { int x = 0; x = x + day; if (month>= 1) { x = x + 31; } else if (month>= 2){ x = x + 28; } else if (month>= 3){ x = x + 31; } else if (month>= 4){ x = x + 30; } else if (month>= 5){ x = x + 31; } else if (month>= 6){ x = x + 30; } else if (month>= 7){ x = x + 31; } else if (month>= 8){ x = x + 31; } else if (month>= 9){ x = x + 30; } else if (month>= 10){ x = x + 31; } else if (month>= 11){ x = x + 30; } else if (month > 12){ x = x + 31; } x--; return x; } int main() { int day=0; int month=0; cout << "Please: Enter the Day: "<< endl; cin >> day; cout << "Please: Enter the Month: "<< endl; cin >> month; month = month - 1; int x = 0; x=dateToNumber(day, month); cout << "The total amount of days are: " << x <<endl; return 0; }
Rushomi Posted March 29, 2016 Posted March 29, 2016 Victorious warriors win first and then go to war, while defeated warriors go to war first and then seek to win., watch and learn!!