Check out example codes for "how to convert n space separated integers in c++". It will help you in understanding the concepts better.

Code Example 1

int i, n, arr[100];

scanf("%d", &n);
for (i = 0; i < n; ++i)
    scanf("%d", &arr[i]);

Learn ReactJs, React Native from akashmittal.com