Begin working through Modern C 2018-ish edition

This commit is contained in:
Dan Buch 2024-04-13 12:07:04 -04:00
parent 1ed7fb7d33
commit 9183869a50
Signed by: meatballhat
GPG Key ID: A12F782281063434
2 changed files with 25 additions and 0 deletions

1
modernc/01.1/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
getting-started

View File

@ -0,0 +1,24 @@
/* This may look like nonsense, but really is -*- mode: C -*- */
#include <stdlib.h>
#include <stdio.h>
/* The main thing that this program does. */
int main(void) {
// Decralations
double A[5] = {
[0] = 9.0,
[1] = 2.9,
[4] = 3.E+25,
[3] = .00007,
};
// Doing some work
for (size_t i = 0; i < 5; ++i) {
printf("element %zu is %g, \tits square is %g\n",
i,
A[i],
A[i]*A[i]);
}
return EXIT_SUCCESS;
}