Если массив одномерный то: #include "stdafx.h"#include <iostream> int proizvedeniye(int m[], int n){ int r = 1; for (int i = 0; i < n; i++) r *= m[i]; return r;} int main(){ const int n = 10; int m[n] = { 1,2,3,4,5,6,7,8,9,1 }; std::cout << proizvedeniye(m, n); system("pause");}
#include "stdafx.h"#include <iostream>
int proizvedeniye(int m[], int n){ int r = 1; for (int i = 0; i < n; i++) r *= m[i]; return r;}
int main(){ const int n = 10; int m[n] = { 1,2,3,4,5,6,7,8,9,1 }; std::cout << proizvedeniye(m, n); system("pause");}