int a;
std::cout<<"Enter hour: ";
std::cin>>a;
std::cout<< a;
This is just for question purpose. Is there any trick to output 01 instead of 1 without using a function? Suppose if the input is 9 I want 09 to be an output but if the 'a' is 2 digit there is no need to add 0.