From 00395e9111db108b81e8fab1fd9078ffc7513bb5 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Fri, 14 Apr 2023 23:04:16 +0300 Subject: [PATCH] rgb to hex --- ~/C/rgbToHex.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 ~/C/rgbToHex.c diff --git a/~/C/rgbToHex.c b/~/C/rgbToHex.c new file mode 100644 index 0000000..e79415c --- /dev/null +++ b/~/C/rgbToHex.c @@ -0,0 +1,12 @@ +#include + +int main(int argc, char const *argv[]) +{ + int red = 0; + int green = 128; + int blue = 64; + + printf("#%.2x%.2x%.2x\n", red, green, blue); + + return 0; +}