fork(5) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. void inicia(int v[5]) {
  5. for (int i = 0; i < 5; i++) {
  6. v[i] = 1 + rand() % 20;
  7. }
  8. }
  9.  
  10. void mostra(int v[5]) {
  11. for (int i = 0; i < 5; i++) {
  12. printf("%d\n", v[i]);
  13. }
  14. }
  15.  
  16. int main() {
  17. int vetor[5];
  18. inicia(vetor);
  19. mostra(vetor);
  20. }
Success #stdin #stdout 0s 2168KB
stdin
Standard input is empty
stdout
4
7
18
16
14