Question: Write a function nexthourthat receives one integer argument, which is an hour of the day, and returns the next hour. This assumes a 12-hour clock;

Write a function nexthourthat receives one integer argument, which is an hour of the day, and returns the next hour. This assumes a 12-hour clock; so, for example, the next hour after 12 would be 1. Here are two examples of calling this function. >> fprintf('The next hour will be %d. ',nexthour(3)) The next hour will be 4. >> fprintf('The next hour will be %d. ',nexthour(12)) The next hour will be 1.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!