반응형
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define SIZE 10
void array_fill(int *A, int size);
int main(void) {
int A[SIZE] = { 0 };
array_fill(A, SIZE);
}
void array_fill(int *A, int size) {
int i;
srand((unsigned)time(NULL));
for (i = 0; i < size; i++) {
A[i] = rand();
printf("%d ", A[i]);
}
}
'프로그래밍 C' 카테고리의 다른 글
쉽게 풀어쓴 C언어 익스프레스 11장 프로그래밍 6번 (0) | 2019.11.20 |
---|---|
쉽게 풀어쓴 C언어 익스프레스 11장 프로그래밍 4번 (0) | 2019.11.14 |
쉽게 풀어쓴 C언어 익스프레스 11장 프로그래밍 2번 (0) | 2019.11.14 |
쉽게 풀어쓴 C언어 익스프레스 10장 프로그래밍 4번 (0) | 2019.11.14 |
쉽게 풀어쓴 C언어 익스프레스 프로그래밍 10장 3번 (0) | 2019.11.14 |