first exercise and extra credit work in Markdown note with screenshots, possibly for publishing later

This commit is contained in:
Joost Agterhoek 2024-08-29 11:01:39 +02:00
parent e4a615aea1
commit a107e72b2a
5 changed files with 30 additions and 0 deletions

4
Makefile Normal file
View File

@ -0,0 +1,4 @@
CFLAGS=-Wall -g
clean:
rm -f ex1

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

BIN
ex1 Normal file

Binary file not shown.

12
ex1-extra-credit.md Normal file
View File

@ -0,0 +1,12 @@
- Open the ex1 file in your text editor and change or delete random parts. Try running it and see what happens.
change: `printf("What the %s is happening!");` - removed `word`
result:
![removed word](assets/imgs/ex1-extra-credit_2024-08-29_09-23-12.png)
change: `char word[] = "HELL";` - removed `char`
result:

14
ex1.c Normal file
View File

@ -0,0 +1,14 @@
#include <stdio.h>
/* This is a comment. */
int main(int argc, char *argv[])
{
int distance = 100;
char word[] = "HELL";
// this is also a comment
printf("You are %d miles away.\n", distance);
printf("What the %s is happening!", word);
return 0;
}