From 9a9e86b386838c1504b40721cd895eb1cb4d5ee0 Mon Sep 17 00:00:00 2001 From: VIliam Date: Fri, 23 Feb 2024 13:58:04 +0100 Subject: [PATCH] capslock --- cv1/program.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 cv1/program.c diff --git a/cv1/program.c b/cv1/program.c new file mode 100644 index 0000000..5a83bef --- /dev/null +++ b/cv1/program.c @@ -0,0 +1,11 @@ +#include <"stdio.h"> + +char simulate_caps_lock(char c) { + if ('a' <= c && c <= 'z') { + return c - ('a' - 'A'); + } else if ('A' <= c && c <= 'Z') { + return c + ('a' - 'A'); + } else { + return c; + } +}