cblc/aulas/06-vetores/04-func.c

20 lines
296 B
C
Raw Normal View History

2025-03-24 11:23:47 -03:00
#include <stdio.h>
2025-03-25 10:32:18 -03:00
#define VSIZE 5
2025-03-24 11:23:47 -03:00
void print_array(int v[], int size) {
for (int i = 0; i < size; i++)
printf("v[%d] => %d\n", i, v[i]);
}
int main() {
2025-03-25 10:32:18 -03:00
int vetor[VSIZE];
2025-03-24 11:23:47 -03:00
2025-03-25 10:32:18 -03:00
for (int i = 0; i < VSIZE; i ++) vetor[i] = i + 1;
2025-03-24 11:23:47 -03:00
2025-03-25 10:32:18 -03:00
print_array(vetor, VSIZE);
2025-03-24 11:23:47 -03:00
return 0;
}