Last active
July 9, 2019 13:32
-
-
Save sujimodern/f4d9cc91538f683d60e242b8da2a99b0 to your computer and use it in GitHub Desktop.
An example of a C program
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* -*- 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