summaryrefslogtreecommitdiff
path: root/wk2/lect2
diff options
context:
space:
mode:
authorFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-02-17 22:59:23 +0000
committerFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-02-17 22:59:23 +0000
commita2682d25c6cd0e069ff73a43df74c17a63caabac (patch)
treebc5621a5a4b99495a64e41d2407cc5cde22061de /wk2/lect2
parentd3c2d73736cc188e7ad089bfb29d42bf29faf881 (diff)
Sat, Feb 17, 2024, 2:59 PM -08:00
Diffstat (limited to 'wk2/lect2')
-rw-r--r--wk2/lect2/greet.c10
-rw-r--r--wk2/lect2/lowercase.c15
-rw-r--r--wk2/lect2/status.c16
-rw-r--r--wk2/lect2/uppercase.c21
4 files changed, 0 insertions, 62 deletions
diff --git a/wk2/lect2/greet.c b/wk2/lect2/greet.c
deleted file mode 100644
index ccecd7d..0000000
--- a/wk2/lect2/greet.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <stdio.h>
-#include <cs50.h>
-
-//argc is argument count, ie how many arguments were given
-//argv is an array of the arguments given
-//argv[0] is the command that calls the script, ie ./greet
-int main(int argc, string argv[])
-{
- printf("hello, %s\n", argv[1]);
-}
diff --git a/wk2/lect2/lowercase.c b/wk2/lect2/lowercase.c
deleted file mode 100644
index ee473ae..0000000
--- a/wk2/lect2/lowercase.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#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");
-}
diff --git a/wk2/lect2/status.c b/wk2/lect2/status.c
deleted file mode 100644
index ebce04c..0000000
--- a/wk2/lect2/status.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <stdio.h>
-#include <cs50.h>
-
-int main(int argc, string argv[])
-{
- if (argc != 2)
- {
- printf("Missing command-line argument\n");
- return 1;
- }
- else
- {
- printf("hello, %s\n", argv[1]);
- return 0;
- }
-}
diff --git a/wk2/lect2/uppercase.c b/wk2/lect2/uppercase.c
deleted file mode 100644
index 3a34b97..0000000
--- a/wk2/lect2/uppercase.c
+++ /dev/null
@@ -1,21 +0,0 @@
-#include <stdio.h>
-#include <cs50.h>
-#include <string.h>
-
-int main(void)
-{
- string s = get_string("Before: ");
- printf("After: ");
- for (int i = 0; i < strlen(s); i++)
- {
- if (s[i] >= 'a' && s[i] <= 'z')
- {
- printf("%c", s[i] - 32);
- }
- else
- {
- printf("%c", s[i]);
- }
- }
- printf("\n");
-}