An array of 10 elements is given, filled with doubled values of the indices of the array elements.

An array of 10 elements is given, filled with doubled values of the indices of the array elements. What is the value of the eighth element of the array.

c ++ program:

#include <iostream>

#include <math.h>

using namespace std;

int main ()

{

const int n = 10;

int s [n], i;

cout << “Enter the elements of your array from the keyboard:” << endl;

for (int i = 0; i <n; i ++)

{cin >> s [i]; s [i] = i * 2;}

cout << “The fourth element of your array is:” << s [8] << endl;

return 0;

}



One of the components of a person's success in our time is receiving modern high-quality education, mastering the knowledge, skills and abilities necessary for life in society. A person today needs to study almost all his life, mastering everything new and new, acquiring the necessary professional qualities.