diff options
| author | David Faulkner <[email protected]> | 2026-08-07 23:40:47 -0500 |
|---|---|---|
| committer | David Faulkner <[email protected]> | 2026-08-07 23:40:47 -0500 |
| commit | b3e9e62599532050fc776c5e8f076915b56c2235 (patch) | |
| tree | af252346106a61b18cc6fc6fdbd32e962d096f1c /bad.c | |
Import official C23 code examples for Modern C (Jens Gustedt, 2024)HEADupstream-importmain
- Add official C source files, Makefile, c23-fallback.h, and LICENSE
- Update README.md with study mirror notice
Diffstat (limited to 'bad.c')
| -rw-r--r-- | bad.c | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -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}*/ +} |
