Skip to content

Commit

Permalink
8-24_hours.c
Browse files Browse the repository at this point in the history
  • Loading branch information
victorpreston committed Jun 20, 2023
1 parent 63815a6 commit ff038e3
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions 0x02-functions_nested_loops/8-24_hours.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include "main.h"
/**
* jack_bauer - prints every minute of the day of Jack Bauer
*
* starting from 00:00 to 23:59
*
*/
void jack_bauer(void)
{
int i, j;

i = 0;

while (i < 24)
{
j = 0;

while (j < 60)
{
_putchar((i / 10) + '0');
_putchar((i % 10) + '0');
_putchar(':');
_putchar((j / 10) + '0');
_putchar((j % 10) + '0');
_putchar('\n');
j++;
}
i++;
}
}

0 comments on commit ff038e3

Please sign in to comment.