int main() {const int n = 10;int a[n] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};int b[n] = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1};int c[n];
}
int main() {
std::cout << "Coordinates of vector c (a + b): ";const int n = 10;
int a[n] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int b[n] = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1};
int c[n];
for(int i = 0; i < n; i++) {
c[i] = a[i] + b[i];
std::cout << c[i] << " ";
}
int sum = 0;
for(int i = 0; i < n; i++) {
sum += c[i] * c[i];
}
std::cout << "\nMagnitude of vector c: " << sqrt(sum) << std::endl;
return 0;
}