From 8e2f5c1ff0bb8b89d5052fd7c53d9b57877f97ad Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Sat, 13 Apr 2024 13:25:31 -0400 Subject: [PATCH] The "bad" getting started --- modernc/01.1/bad.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 modernc/01.1/bad.c diff --git a/modernc/01.1/bad.c b/modernc/01.1/bad.c new file mode 100644 index 0000000..e434f6e --- /dev/null +++ b/modernc/01.1/bad.c @@ -0,0 +1,23 @@ +/* This may look like nonsense, but really is -*- mode: C -*- */ + +/* The main thing that this program does. */ +void main() { + // Decralations + int i; + double A[5] = { + 9.0, + 2.9, + 3.E+25, + .00007, + }; + + // Doing some work + for (i = 0; i < 5; ++i) { + printf("element %d is %g, \tits square is %g\n", + i, + A[i], + A[i]*A[i]); + } + + return 0; +}