Given an integer array of 10 elements, write a program that finds the sum of array elements that are multiples of 3 or 5?

Solving a problem in C ++

#include <iostream>
#include <ctime>
using namespace std;
void main ()
{
setlocale (LC_ALL, “rus”);
srand (time (0));
int const N = 10;
int mas [N], sum = 0;
cout << “Array elements:” << endl;
for (int i = 0; i <N; i ++)
{
mas [i] = rand ()% 100;
cout << mas [i] << “”;
if (mas [i]% 3 == 0 || mas [i]% 5 == 0)
{
sum + = mas [i];
}
}
cout << endl << “Sum of elements that are multiples of 3 or 5:” << sum << endl;
system (“pause”);
}



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.