In this question, you’ll split an array into two arrays that are half the size. Your code should declare an array of
integers called ‘array’ that holds 20 integers. Also, declare two arrays called ‘small1’ and ‘small2’ that can hold
10 integers each. Fill the large array with random numbers that are between 0 and 99. Next, copy the first 10
elements from ‘array’ into ‘small1’ and copy the last 10 elements of ‘array’ into ‘small2’.
Update:it's for programming c
Copyright © 2024 1QUIZZ.COM - All rights reserved.
Answers & Comments
What programming language do you need to use?
int array[20];
I'm not going to give you the full code, but an array is written like the one above.
Declare the variable type (int)
Declare the array name (array)
Declare how many spaces are in the array ([20]);
Now, if you ever need to just start the array with values in there you could type it like this:
int array[20] = {1, 2, 3, 4, 5, 6, 7, 8, 9}
^^ in that example, after number 9 the rest of the spaces would start as 0.