Skip to content

Instantly share code, notes, and snippets.

@sujimodern
Last active July 9, 2019 13:32
Show Gist options
  • Save sujimodern/f4d9cc91538f683d60e242b8da2a99b0 to your computer and use it in GitHub Desktop.
Save sujimodern/f4d9cc91538f683d60e242b8da2a99b0 to your computer and use it in GitHub Desktop.
An example of a C program
/* -*- mode: C -*- */
#include <stdlib.h>
#include <stdio.h>
/* プログラムの本体 */
int main(void) {
// 宣言
double A[5] = {
[0] = 9.0,
[1] = 2.9,
[4] = 3.E+25,
[3] = .00007,
};
// 処理をする
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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment