diff --git a/Homework1.c b/Homework1.c new file mode 100644 index 0000000..7c3075f --- /dev/null +++ b/Homework1.c @@ -0,0 +1,17 @@ +#include +#include + +int main(void){ + int a = 6; + int b = 8; + int c = 10; + if (ca+b){ + printf("This isn't a triangle\n"); + } + + return 0; +} \ No newline at end of file diff --git a/Homework2.c b/Homework2.c new file mode 100644 index 0000000..19609b9 --- /dev/null +++ b/Homework2.c @@ -0,0 +1,14 @@ +#include +#include + +int main(void){ + int arr[4] = { 5, 7, 1, 6 }; + int len = 0; + while(arr[len] != '\0'){ + len++; + } + + printf("The length of the array is %d\n", len); + + return 0; +} \ No newline at end of file diff --git a/Homework3.c b/Homework3.c new file mode 100644 index 0000000..26e7ddf --- /dev/null +++ b/Homework3.c @@ -0,0 +1,14 @@ +#include +#include + +int main(void){ + int arr[6] = { 0, 3, 5, 2, 4, 10 }; + // Find the element 4 + for (int i = 0; i < 8; i++){ + if(arr[i] == 4){ + printf("Ans found: %d", arr[i]); + } + } + + return 0; +} \ No newline at end of file diff --git a/homework1.exe b/homework1.exe new file mode 100644 index 0000000..f0ca0bc Binary files /dev/null and b/homework1.exe differ diff --git a/homework2.exe b/homework2.exe new file mode 100644 index 0000000..cf645e4 Binary files /dev/null and b/homework2.exe differ diff --git a/homework3.exe b/homework3.exe new file mode 100644 index 0000000..5a145db Binary files /dev/null and b/homework3.exe differ