Advertisement
Mrhackermachine

Test Array

May 28th, 2020
967
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.34 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int arr[100];
  7.    
  8.     int n;
  9.     printf("Quanti valori vuoi inserire? \n");
  10.     scanf("%d", &n);
  11.     for(int i = 0; i < n; i++)
  12.     {
  13.         printf("Inserisci il valore numero: %d ", i, "\n");
  14.         scanf("%d", &arr[i]);
  15.     }
  16.     for(int j = 0; j < n; j++)
  17.     {
  18.         printf("[ %d", arr[j]);
  19.         printf("] ");
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement