Hi can someone help in in understanding the following code esp the "?".I cant understand how the output 9:10:5 as obtained.
Thank You.
The code is as followed:
#include <iostream>
using namespace std;
int main()
{
short hour =9, minute =10, second =5;
cout << (hour <10 ? "0":"" )<<hour<<":"
<< (minute <10 ? "0":"" )<<minute<<":"
<< (second <10 ? "0":"" )<<second<<endl;
cin.get();
return 0;
}