From b3e9e62599532050fc776c5e8f076915b56c2235 Mon Sep 17 00:00:00 2001 From: David Faulkner Date: Fri, 7 Aug 2026 23:40:47 -0500 Subject: Import official C23 code examples for Modern C (Jens Gustedt, 2024) - Add official C source files, Makefile, c23-fallback.h, and LICENSE - Update README.md with study mirror notice --- bad.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 bad.c (limited to 'bad.c') diff --git a/bad.c b/bad.c new file mode 100644 index 0000000..7253662 --- /dev/null +++ b/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() { + // Declarations + 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", /*@\label{printf-start-badly}*/ + i, + A[i], + A[i]*A[i]); /*@\label{printf-end-badly}*/ + } + + return 0; /*@\label{main-return-badly}*/ +} -- cgit v1.2.3