From f4ba752e04220c4c66858fbd77edf930dbf46afe Mon Sep 17 00:00:00 2001 From: BrendanTCC Date: Sun, 7 Mar 2021 13:30:19 +1100 Subject: [PATCH] initial commit --- helloworld.c | 8 ++++++++ math.c | 13 +++++++++++++ variables-windows.c | 12 ++++++++++++ variables.c | 12 ++++++++++++ 4 files changed, 45 insertions(+) create mode 100644 helloworld.c create mode 100644 math.c create mode 100644 variables-windows.c create mode 100644 variables.c diff --git a/helloworld.c b/helloworld.c new file mode 100644 index 0000000..b165345 --- /dev/null +++ b/helloworld.c @@ -0,0 +1,8 @@ +#include +int main() { + int me = 69; + printf("hello world.\n"); + printf("%d", me); + printf("\n"); + return 0; +} \ No newline at end of file diff --git a/math.c b/math.c new file mode 100644 index 0000000..d3bc6f5 --- /dev/null +++ b/math.c @@ -0,0 +1,13 @@ +/* +a math thing to correct anton +*/ +#include +int main() { + int a = 2; + int b = 2; + float sum; + + sum = a + b; + printf("2+2 is %f.\n", sum); + return 0; +} \ No newline at end of file diff --git a/variables-windows.c b/variables-windows.c new file mode 100644 index 0000000..8da3096 --- /dev/null +++ b/variables-windows.c @@ -0,0 +1,12 @@ +/* +a thing to self-teach variables. +*/ +#include +int main() { + char name[9999]; + printf("what's your name?\n"); + scanf("%s", name); + system("cls"); + printf("hello, %s.\n", name); + return 0; +} \ No newline at end of file diff --git a/variables.c b/variables.c new file mode 100644 index 0000000..7731f62 --- /dev/null +++ b/variables.c @@ -0,0 +1,12 @@ +/* +a thing to self-teach variables. +*/ +#include +int main() { + char name[9999]; + printf("what's your name?\n"); + scanf("%s", name); + system("clear"); + printf("hello, %s.\n", name); + return 0; +} \ No newline at end of file