【課題3−1】

 

(プログラム例)

#include <stdio.h>

#define ARRAY_SIZE 10

int main(void) {

         float data[ARRAY_SIZE]=

                 {0.1, 1.2, 2.3, 3.4, 4.5, 5.6, 6.7, 7.8, 8.9, 9.0};

         int i;

         float temp;

 

         for (i = 0; i < ARRAY_SIZE/2; i++) {

                 temp = data[i];

                 data[i]=data[ARRAY_SIZE-i-1];

                 data[ARRAY_SIZE-i-1]=temp;

         }

 

         for (i = 0; i < ARRAY_SIZE; i++) {

                 printf("%3.1f\n", data[i]);

         }

         return 0;

}