arrays | Sololearn: Learn to code for FREE!

+19

arrays

Guys somebody please show me a program that calculate and return the multiplication product of the array elements.

c++

10/27/2016 11:32:28 AM

Corne

2 Answers

New Answer

+16

int mult=1; for(int i=0;i<arr.length;i++) { mult*=arr[i]; } return mult;

+3

#include <iostream> using namespace std ; main { int length, num, mult=1 ; cout << ''Please enter limit for array : " ; cin >> length ; arr{length} ; for (int i=0; i<length; i++) { cout << "Enter an element " ; cin >> num ; arr{i} = num ; mult *= arr{i} ; } cout << "Your multiplication is " << mult ; }