# Time when minute hand and hour hand coincide

Given time in hours, find the time in minute at which the minute hand and hour hand coincide in next one hour.

**Examples :**

Input : 3 Output : (180/11) minutes Input :7 Output : (420/11) minutes

**Approach :**

1. Take two variables for hour “h1 and h2” and then find the angle “theta” [theta = (30 * h1)] and then divide it by “11” to find the time in minute(m). We are dividing with 11, because the hands of a clock coincide 11s time in 12 hours and 22 times in 24 hours :

**Formula :** This can be calculated using the formula for time h1 to h2 means [11m / 2 – 30 (h1)]

this implies [ m = ((30 * h1) * 2) / 11 ] ]

[ m = (theta * 2) / 11 ]

where [theta = (30 * h1) ]

where A and B are hours i.e if given hour is (2, 3) then A = 2 and B = 3 .

## C++

`// CPP code to find the minute at which ` `// the minute hand and hour hand coincide ` `#include <bits/stdc++.h> ` `using` `namespace` `std; ` ` ` `// function to find the minute ` `void` `find_time(` `int` `h1) ` `{ ` ` ` `// finding the angle between minute ` ` ` `// hand and the first hour hand ` ` ` `int` `theta = 30 * h1; ` ` ` `cout << ` `"("` `<< (theta * 2) << ` `"/"` ` ` `<< ` `"11"` ` ` `<< ` `")"` ` ` `<< ` `" minutes"` `; ` `} ` ` ` `// Driver code ` `int` `main() { ` ` ` `int` `h1 = 3; ` ` ` `find_time(h1); ` ` ` `return` `0; ` `} ` |

*chevron_right*

*filter_none*

## JAVA

`// Java code to find the minute ` `// at which the minute hand and ` `// hour hand coincide ` `import` `java.io.*; ` ` ` `class` `GFG ` `{ ` ` ` ` ` `// function to find the minute ` ` ` `static` `void` `find_time(` `int` `h1) ` ` ` `{ ` ` ` ` ` `// finding the angle between ` ` ` `// minute hand and the first ` ` ` `// hour hand ` ` ` `int` `theta = ` `30` `* h1; ` ` ` `System.out.println(` `"("` `+ theta * ` ` ` `2` `+ ` `"/"` `+ ` ` ` `" 11 ) minutes"` `); ` ` ` `} ` ` ` ` ` `//Driver Code ` ` ` `public` `static` `void` `main (String[] args) ` ` ` `{ ` ` ` `int` `h1 = ` `3` `; ` ` ` `find_time(h1); ` ` ` `} ` `} ` ` ` `// This code is contributed by ` `// upendra singh bartwal ` |

*chevron_right*

*filter_none*

## Python3

`# Python3 code to find the ` `# minute at which the minute ` `# hand and hour hand coincide ` ` ` `# Function to find the minute ` `def` `find_time(h1): ` ` ` ` ` `# Finding the angle between ` ` ` `# minute hand and the first ` ` ` `# hour hand ` ` ` `theta ` `=` `30` `*` `h1 ` ` ` `print` `(` `"("` `, end ` `=` `"") ` ` ` `print` `((theta ` `*` `2` `),` `"/ 11) minutes"` `) ` ` ` `# Driver code ` `h1 ` `=` `3` `find_time(h1) ` ` ` `# This code is contributed by ` `# Smitha Dinesh Semwal ` |

*chevron_right*

*filter_none*

## C#

`// C# code to find the minute ` `// at which the minute hand ` `// and hour hand coincide ` `using` `System; ` ` ` `class` `GFG ` `{ ` ` ` ` ` `// function to find the minute ` ` ` `static` `void` `find_time(` `int` `h1) ` ` ` `{ ` ` ` ` ` `// finding the angle between minute ` ` ` `// hand and the first hour hand ` ` ` `int` `theta = 30 * h1; ` ` ` `Console.WriteLine(` `"("` `+ theta * 2 + ` ` ` `"/"` `+ ` `" 11 )minutes"` `); ` ` ` `} ` ` ` ` ` `//Driver Code ` ` ` `public` `static` `void` `Main() ` ` ` `{ ` ` ` `int` `h1 = 3; ` ` ` ` ` `find_time(h1); ` ` ` `} ` `} ` ` ` `// This code is contributed by vt_m. ` |

*chevron_right*

*filter_none*

## PHP

`<?php ` `// PHP code to find the minute ` `// at which the minute hand and ` `// hour hand coincide ` ` ` `// function to find the minute ` `function` `find_time(` `$h1` `) ` `{ ` ` ` `// finding the angle between ` ` ` `// minute hand and the first ` ` ` `// hour hand ` ` ` `$theta` `= 30 * ` `$h1` `; ` ` ` `echo` `(` `"("` `. (` `$theta` `* 2) . ` ` ` `"/"` `. ` `"11"` `. ` `")"` `. ` ` ` `" minutes"` `); ` `} ` ` ` `// Driver code ` `$h1` `= 3; ` `find_time(` `$h1` `); ` ` ` `// This code is contributed by Ajit. ` `?> ` |

*chevron_right*

*filter_none*

**Output :**

(180/11) minutes

Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.

## Recommended Posts:

- Calculate the angle between hour hand and minute hand
- Distance between end points of Hour and minute hand at given time
- Distance traveled by Hour and Minute hand in given Time interval
- Find time when hour and minute hands superimpose
- Find a time for which angle between hour and minute hands is given theta
- Python program to convert time from 12 hour to 24 hour format
- Program to convert time from 12 hour to 24 hour format
- Convert time from 24 hour clock to 12 hour clock format
- Time taken per hour for stoppage of Car
- Time difference between expected time and given time
- Changing One Clock Time to Other Time in Minimum Number of Operations
- Minimum time to reach a point with +t and -t moves at time t
- Program to find the time after K minutes from given time
- Add given n time durations
- Convert given time into words
- Calculate the IST : Indian Standard Time
- Maximum possible time that can be formed from four digits
- Calculate speed, distance and time
- Print system time in C++ (3 different ways)
- Sieve of Eratosthenes in 0(n) time complexity

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.