You are viewing a single comment's thread. Return to all comments →
There is no problem with the code. The problem is because of the underlying architecture on which your compiler is running.
I tried it on windows, it gives correct result but gives wrong answer on linux.
See this http://ideone.com/EV58mh
Here 'time' is stored before 'hour'.
Same is happenning in your case and you are not getting correct value for ss.