Simvik

Minutes to seconds

Convert a duration with one multiplication. An easy embedded C problem (First steps in C), run and graded in the browser.

easy · First steps in C · arithmetic

A timer is configured in seconds, but the user enters minutes.

Return the number of seconds in minutes minutes.

Starter code

int to_seconds(int minutes) {
  return 0;
}

Example tests

One minute

printf("%d\n", to_seconds(1));

Expected output:

60

Five minutes

printf("%d\n", to_seconds(5));

Expected output:

300

Learn it first

More First steps in C problems