In objective-c, how can I convert an integer (representing seconds) to days, minutes, an hours?
Thanks!
Try doing the following:
x=int(input("enter a positive integer: ")) sec = int(x % 60); minu =int((x % 3600) / 60); ho =int((x % 86400) / 3600); days =int(x / (60 * 60 * 24)); print(int(days),"days", ho,"hours", minu , "minutes" , sec ,"seconds" )