diff --git a/DeitelC/Chapter3Test/a.out b/DeitelC/Chapter3Test/a.out new file mode 100644 index 0000000..296fb25 Binary files /dev/null and b/DeitelC/Chapter3Test/a.out differ diff --git a/DeitelC/Chapter3Test/float.c b/DeitelC/Chapter3Test/float.c new file mode 100644 index 0000000..c9d48d9 --- /dev/null +++ b/DeitelC/Chapter3Test/float.c @@ -0,0 +1,35 @@ +#include + +int main(void) { + + float f = 123.456; + printf("%.2f\n", f); + + f = 3.14159; + printf("%.3f\n", f); // 3.3 examples + + int x = 1, sum = 0; + + while (x < 11) { + sum = x + sum; + x++; + } + printf("And the sum is: %d\n", sum); // 3.4 and 3.5 examples + + + printf("Enter int x: \n"); + scanf("%d", &x); + + int y; + printf("Enter int y: \n"); + scanf("%d", &y); + + int i = 1; + + while (y > 0) { + i *= x; + y--; + } + printf("Result is: %d\n", i); + +} diff --git a/DeitelC/Chapter4/a.out b/DeitelC/Chapter4/a.out new file mode 100644 index 0000000..db8e620 Binary files /dev/null and b/DeitelC/Chapter4/a.out differ diff --git a/test/a.out b/test/a.out new file mode 100644 index 0000000..a4237ea Binary files /dev/null and b/test/a.out differ diff --git a/test/alert.c b/test/alert.c new file mode 100644 index 0000000..e9d5984 --- /dev/null +++ b/test/alert.c @@ -0,0 +1,6 @@ +#include + +int main(void) { + printf("Alert!\a"); + return 0; +} \ No newline at end of file diff --git a/test1.c b/test/test1.c similarity index 100% rename from test1.c rename to test/test1.c diff --git a/test2.c b/test/test2.c similarity index 100% rename from test2.c rename to test/test2.c