Computer Science, asked by sutkamakhyaprasad33, 11 days ago

Question No: 22
Rohit reached office at 9:45:56 hours on
1st June 2019 and Rahul reached at
9:45:56 hours on 1st June 2019. Rohit
left from the office at 14:45:56 hours on
1st June 2019 and Rahul left from the
office at 15:45:56 hours on 1st June
2019. How many total seconds did they
both put together spend in the office.
Example Input - If both Rahul and Rohit
came and left the office at the same time
as below:
IN TIME - 2019-01-01 15:45:56
OUT TIME - 2019-01-01 15:46:56
Example Output:
120

Answers

Answered by amitnrw
6

Given : Rohit reached office at 9:45:56 hours on 1st June 2019 and Rahul reached at 9:45:56 hours on 1st June 2019. Rohit left from the office at 14:45:56 hours on 1st June 2019 and Rahul left from the

office at 15:45:56 hours on 1st June 2019.

To Find : How many total seconds did they both put together spend in the office.

Solution:

First check who cam late :

in this case both came at same time 9:45:56 hours

Then find who left early

in this case Rohit left early at 14:45:56 hours

Subtract  late coming time from early left time

14:45:56  -  9:45:56

= 5 hrs

Convert hrs into minutes

5 * 3600

= 18000

They spent 18000 secs together.

Learn More:

A digital clock reads hours and minutes. The sum of the digits it ...

https://brainly.in/question/33779191?tbs_match=1

Answered by vaibhav13550
5

Answer:

First check who came late :

in this case both came at same time 9:45:56

hours

Then find who left early

in this case Rohit left early at 14:45:56 hours

Subtract late coming time from early left time

14:45:56 9:45:56

= 5 hrs

Convert hrs into minutes

5 * 3600

= 18000

They spent 18000 secs together.

Similar questions