MCPcopy Create free account
hub / github.com/chaharnishant11/CodeIn10DSA / productArray

Function productArray

C++/Homework/productOfArrayElement.cpp:4–12  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2using namespace std;
3
4int productArray(int arr[], int n){
5 int pr=1;
6 for(int i=0;i<n;i++){
7 if(arr[i]==0){ return 0; }
8 pr=pr*arr[i];
9
10 }
11 return pr;
12}
13
14int main(){
15 int arr[4] = {6,2,6,3};

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected