Program to find the time remaining for the day to complete | Function to find the remaining time ; Formula for total remaining minutes = 1440 - 60 h - m ; Remaining hours ; Remaining minutes ; Driver code ; Current time ; Get the remaining time
#include <bits/stdc++.h> NEW_LINE using namespace std ; void remainingTime ( int h , int m ) { int totalMin , hoursRemaining , minRemaining ; totalMin = 1440 - 60 * h - m ; hoursRemaining = totalMin / 60 ; minRemaining = totalMin % 60 ; cout << hoursRemaining << " : : " << minRemaining << endl ; } int main ( ) { int h = 0 , m = 1 ; remainingTime ( h , m ) ; return 0 ; }