why is the output always 1:00?
#include <iostream> using namespace std; void input (int hour, int min, char mode); void convert (int hour, int min, char mode); void output (int hour, int min, char mode); int main(){ int hour, min; char mode; input (hour, min, mode); convert (hour, min, mode); output (hour, min, mode); return 0; } void input (int hour, int min, char mode){ do{ cout << "Enter hour/s: " << endl; cin >> hour; cout << "Enter minute/s: " << endl; cin >> min; cout << "Enter A or P: " << endl; cin >> mode; if ((hour<1 && hour>12)||(min<0 && min>59)||(mode!='A' && mode!='P')){ cout << "Invalid inputs. Try again." << endl; continue; } break; } while (1); } void convert (int hour, int min, char mode){ switch (mode){ case 'P': hour = hour + 12; break; case 'A': if (hour==12){ hour = 00; } else{ hour = hour; break; } } } void output (int hour, int min, char mode){ if (min<=9){ cout << "24-hr Time Mode: " << hour << ":0" << min; } else{ cout << "24-hr Time Mode: " << hour << ":" <<min; } }