Compare commits
2 Commits
1ed7fb7d33
...
8e2f5c1ff0
Author | SHA1 | Date | |
---|---|---|---|
8e2f5c1ff0 | |||
9183869a50 |
1
modernc/01.1/.gitignore
vendored
Normal file
1
modernc/01.1/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
getting-started
|
23
modernc/01.1/bad.c
Normal file
23
modernc/01.1/bad.c
Normal file
@ -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;
|
||||||
|
}
|
24
modernc/01.1/getting-started.c
Normal file
24
modernc/01.1/getting-started.c
Normal 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;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user