fork download
  1. #include <stdio.h>
  2. #define SIZE 10
  3.  
  4. int main() {
  5. double fractions[SIZE] = {0.0};
  6.  
  7. fractions[4];
  8. fractions[9] = 1.667;
  9. fractions[6] = 3.333;
  10.  
  11. printf("%.2f %.2f\n", fractions[6], fractions[9]);
  12.  
  13. for (size_t x = 0; x < SIZE; ++x) {
  14. printf("%f\n", fractions[x]);
  15. }
  16.  
  17. return 0;
  18. }
Success #stdin #stdout 0s 5312KB
stdin
Standard input is empty
stdout
3.33 1.67
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
3.333000
0.000000
0.000000
1.667000