Advertisement
Wolfrost

Untitled

May 31st, 2016
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Traccia 1
  2.  
  3. #include <stdlib.h>
  4. #include <stdio.h>
  5.  
  6. main()
  7. {
  8.     int vet[50], vet_copia[50], dim, i;
  9.    
  10.     printf("Inserire la dimensione del vettore (Massimo 50 elementi):\n");
  11.     scanf("%d",&dim);
  12.    
  13.     for (i=0; i<dim; i++)
  14.     {
  15.         printf("Inserisci vet[%d]: ", i);
  16.         scanf("%d",&vet[i]);
  17.     }
  18.    
  19.     for (i=0; i<dim; i++)
  20.     {
  21.         vet_copia[i] = vet[i];
  22.     }
  23.    
  24.     printf("Ho copiato vet in vet_copia\n");
  25.     printf("Elementi di vet_copia:\n");
  26.    
  27.     for (i=0; i<dim; i++)
  28.     {
  29.         printf("%d\n",vet_copia[i]);
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement