feat: c beginning
This commit is contained in:
136091
book/modernC.pdf
Normal file
136091
book/modernC.pdf
Normal file
File diff suppressed because it is too large
Load Diff
19
examples/listing-1.1.c
Normal file
19
examples/listing-1.1.c
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
/* This may look like nonsense, but really is -*- mode: C -*- */
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
/* The main thing that this program does. */
|
||||||
|
int main(int argc, [[maybe_unused]] char *argv[argc + 1]) {
|
||||||
|
// Declarations
|
||||||
|
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;
|
||||||
|
};
|
||||||
BIN
listing-1.1
Executable file
BIN
listing-1.1
Executable file
Binary file not shown.
Reference in New Issue
Block a user