We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
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.
Time Conversion
You are viewing a single comment's thread. Return to all comments →
@Andyuriarte
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.