update C snipplets

This commit is contained in:
2024-04-27 23:54:46 +03:00
parent 42d18ccae1
commit f2b20118e0
59 changed files with 589 additions and 831 deletions

View File

@@ -0,0 +1,11 @@
#include <stdio.h>
int main(int argc, char const *argv[]) {
int red = 0;
int green = 128;
int blue = 64;
printf("#%.2x%.2x%.2x\n", red, green, blue); // #008040
return 0;
}

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;
}