Search
 
SCRIPT & CODE EXAMPLE
 

CPP

c++ hours minutes seconds

int seconds, hours, minutes;
cin >> seconds;
minutes = seconds / 60;
hours = minutes / 60;
cout << seconds << " seconds is equivalent to " << int(hours) << " hours " << int(minutes%60) 
     << " minutes " << int(seconds%60) << " seconds.";
Comment

PREVIOUS NEXT
Code Example
Cpp :: C++ switch - case - break 
Cpp :: c++ code for quicksort 
Cpp :: c++ check if char is number 
Cpp :: c++ string comparison 
Cpp :: how to write something in power of a number in c++ 
Cpp :: c++ call by value vs call by reference 
Cpp :: string to int in c++ 
Cpp :: check if file is empty c++ 
Cpp :: data types ranges c++ 
Cpp :: c++ iterate map 
Cpp :: c++ vector loop delete 
Cpp :: delete one specific character in string C++ 
Cpp :: opencv c++ image write 
Cpp :: all data types in c++ 
Cpp :: primes in range cpp 
Cpp :: header file for unordered_map in c++ 
Cpp :: why we use iostream in C++ programming 
Cpp :: c++ colored output 
Cpp :: index string c++ 
Cpp :: declaring 2d dynamic array c++ 
Cpp :: C++ String Length Example 
Cpp :: c++ pause linux 
Cpp :: use uint in c++ 
Cpp :: opencv open image c++ 
Cpp :: reverse level order traversal 
Cpp :: c++ insert into map 
Cpp :: c++ struct 
Cpp :: power function c++ 
Cpp :: stack implementation through linked list 
Cpp :: C++ Conditions and If Statements 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =