summaryrefslogtreecommitdiff
path: root/wk2/lect2
diff options
context:
space:
mode:
authorFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2023-12-05 05:06:40 +0000
committerFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2023-12-05 05:06:40 +0000
commit8f52e004a9914d769131a345b8377b40a426243e (patch)
tree15122039e7e71a072a72fa9478f7fea5f4fc4529 /wk2/lect2
parentcf87d5fad0f55d7742417dde1694fc61eaa6564a (diff)
Mon, Dec 4, 2023, 9:06 PM -08:00
Diffstat (limited to 'wk2/lect2')
-rw-r--r--wk2/lect2/lowercase.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/wk2/lect2/lowercase.c b/wk2/lect2/lowercase.c
new file mode 100644
index 0000000..ee473ae
--- /dev/null
+++ b/wk2/lect2/lowercase.c
@@ -0,0 +1,15 @@
+#include <stdio.h>
+#include <ctype.h>
+#include <cs50.h>
+#include <string.h>
+
+int main(void)
+{
+ string s = get_string("Before: ");
+ printf("After: ");
+ for (int i = 0, n = strlen(s); i < n; i++)
+ {
+ printf("%c", tolower(s[i]));
+ }
+ printf("\n");
+}