Добавил пример преобразования секунд

This commit is contained in:
Alexander Popov 2024-01-28 20:17:27 +03:00
parent d40e4c660b
commit 6f497d3e7c
Signed by: iiiypuk
GPG Key ID: E47FE0AB36CD5ED6
2 changed files with 15 additions and 0 deletions

View File

@ -1,5 +1,9 @@
# C
## Other
- [seconds_to_minutes_and_hours.c](seconds_to_minutes_and_hours.c) - Преобразование секунд в минуты и часы
## SQLite 3
- [CREATE TABLE](sqlite/sqlite3_create.c)

View File

@ -0,0 +1,11 @@
#include <stdio.h>
int main(int argc, char const *argv[]) {
unsigned int seconds = 800000 + 61;
unsigned int minutes = seconds / 60;
unsigned int hours = minutes / 60;
printf("H: %d\nM: %d\nS: %d\n", hours, minutes % 60, seconds % 60);
return 0;
}