Type in the missing parts to print myArray's elements to the screen using the for loop. int myArray[4] = { 1, 2, 3, 4 }; | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 10

Type in the missing parts to print myArray's elements to the screen using the for loop. int myArray[4] = { 1, 2, 3, 4 };

19th Nov 2016, 12:56 AM
Johann Velazquez
Johann Velazquez - avatar
18 Answers
+ 3
Type in the missing parts to print myArray's elements to the screen using the for loop. int myArray[4] = { 1, 2, 3, 4 }; for (int x = 0; x < 4; i++) cout << myArray[x] << ' ';
21st May 2019, 9:36 AM
Arnold Daanoy Jr
Arnold Daanoy Jr - avatar
+ 2
Fill in the blanks to print to the screen the first and the last elements of an array with a size of 5. This is the question. cout << arr[0] << endl; cout << arr[4] << endl; This is the answer. Regards.
13th Apr 2020, 7:03 AM
Waled Moumari
Waled Moumari - avatar
+ 2
14 cin
6th Jun 2020, 5:24 PM
Frederick John Suerte
Frederick John Suerte - avatar
+ 1
Type in the missing parts of the function calcSum, which takes an array and its size as parameters. The function calculates the sum of the array elements and prints to the screen. Answer: void calcSum(int arr[], int size) { int sum = 0; for (int x = 0; x < size; x++) { sum += arr[x]; } cout << sum << endl; }
17th Sep 2020, 4:00 AM
OjeifoIduma
0
thanks the lessons is well
3rd Oct 2018, 5:19 PM
mustafe Adam Mohamoud
mustafe Adam Mohamoud - avatar
0
answer 3 and arr
10th Dec 2021, 3:16 AM
Benmar N. Sibonga
Benmar N. Sibonga - avatar
0
cout << arr [0] [1] << endl;
24th May 2022, 1:07 PM
Shodiyor Tuychivoyev
0
Type in a code to declare an array of integers of size 4: ANSWER : int x [4] = {1,2,3,4}
16th Sep 2022, 5:40 PM
Ben Khlifa Abdellah
Ben Khlifa Abdellah - avatar
0
thank you brothers
17th Sep 2022, 3:43 AM
NARESH M
NARESH M - avatar
- 1
Type in a code to declare a pointer 'ptr' to int and assign its value to var's address.
30th Aug 2018, 8:25 PM
Israel Moupi
- 1
think to well
5th Oct 2018, 6:40 PM
mustafe Adam Mohamoud
mustafe Adam Mohamoud - avatar
- 1
It's not correct answer
5th May 2020, 5:23 AM
Parkavi
Parkavi - avatar
- 1
Fill in the blanks to print all elements of the array arr containing 3 elements: for (int x = 0; x < 3 ; x++) { cout << endl; } << [x]
17th May 2021, 12:29 PM
Mortada majed
Mortada majed - avatar
- 2
blacks xdd
27th Jun 2017, 2:12 AM
Happie Dogger
Happie Dogger - avatar
- 2
for (int x = 0; x < 4; x++) { cout << myArray[x] << endl; }
16th Mar 2019, 2:49 AM
Pome Turtle
Pome Turtle - avatar
- 3
Type in a code to declare an array myArray of 14 integers and enter the elements' values using the cin operator.
30th Aug 2018, 8:24 PM
Israel Moupi
- 3
Type in a code to declare an array of integers of size 4: int x 4 = {1, 2, 3, 4};
6th Dec 2020, 3:05 PM
Abdelmoula Ezzaouia
Abdelmoula Ezzaouia - avatar
- 8
#include <iostream> using namespace std; int main() { int myArray[4] = { 1, 2, 3, 4 }; for (int i = 0; i < 4; i++) cout << myArray[i] << ' '; return 0; }
19th Nov 2016, 1:19 AM
scott johnson
scott johnson - avatar