배열 - 배열 수행평가3(배열초기화1)

2018. 7. 8. 11:41algorithm/dimigo.goorm.io

#include <stdio.h>


int main() {

int num;

int i;

double a[10];

scanf("%d", &num);

a[0] = num;

for (i = 1; i < 10; i++) {

a[i] = a[i - 1] + 0.1;

}

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

printf("%.1lf ", a[i]);

}


}