#include <stdlib.h>#include <stdio.h> int main(void){ double A[5] = { [0] = 9.0, [1] = 4.5, [3] = .00000008, [4] = 4.E+24, }; 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;}
Standard input is empty
Element 0 is 9, its square is 81 Element 1 is 4.5, its square is 20.25 Element 2 is 0, its square is 0 Element 3 is 8e-08, its square is 6.4e-15 Element 4 is 4e+24, its square is 1.6e+49
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!