- 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 };
18 ответов
+ 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] << ' ';
+ 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.
+ 2
14
cin
+ 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;
}
0
thanks the lessons is well
0
answer 3 and arr
0
cout << arr [0] [1] << endl;
0
Type in a code to declare an array of integers of size 4:
ANSWER :
int x [4] = {1,2,3,4}
0
thank you brothers
- 1
Type in a code to declare a pointer 'ptr' to int and assign its value to var's address.
- 1
think to well
- 1
It's not correct answer
- 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]
- 2
blacks xdd
- 2
for (int x = 0; x < 4; x++) {
cout << myArray[x] << endl;
}
- 3
Type in a code to declare an array myArray of 14 integers and enter the elements' values using the cin operator.
- 3
Type in a code to declare an array of integers of size 4:
int
x
4
= {1, 2, 3, 4};
- 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;
}