Studying an analog clock is a ability that some youngsters have to grasp as of late. Oh, I’m positive that finally everybody figures it out. Once I was a child, digital clocks had been uncommon. No, all of us realized find out how to inform time by taking a look at a spherical disk with 12 numbers and a giant hand and a bit of hand. If a second hand was obtainable, properly it was simply extra leisure for the terminally bored little one.
Earlier than entering into this month’s problem, which is the massive hand and which is the little hand? Is the little hand the quick, squat one? Or is the little hand the one which tells minutes? I can see how some younger folks could also be confused. No matter.
Determine 1 illustrates an analog clock exhibiting 3:00, PM or AM. The minute hand (the lengthy one) is pointed straight up at 12. The hour hand (the quick one) is pointed on the 3. The angular distinction between these two arms is 90°. It’s additionally 270° in case you go across the great distance, however I favor 90°.
Determine 1. It’s three o’clock.
Your activity for this month’s C programming train is to code a program that calculates the angle between the 2 clock arms. Settle for legitimate enter for hours and minutes. Then decide the angle between the arms on an analog clock, just like the one proven in Determine 1.
I’ve some guidelines.
First, be sure that the angle is all the time constructive. Whilst you can say that the angle in Determine 1 is -90°, your program ought to report it as constructive 90°.
Second, all the time report the smallest angle. For instance, in Determine 1 the result’s 90° and never 270° (or -270°).
Here’s a pattern run from my resolution:
Enter the hour: 3 Enter the minute: 0 The angle for 3:00 is 90 levels
This downside could not make sense in case you’re too younger to recollect analog clocks, however age shouldn’t be an excuse. The aim is to make use of your C programming expertise to code the clock angle downside. Many options are doable with this puzzle. I’ll submit mine in per week.

