Welcome to MindCipher, a social repository of the world's greatest brain teasers, logic puzzles and mental challenges.

yuktijain

Likes 0

yuktijain must be new here...

Ratings 0

No ratings yet!

Comments 1

Products Algorithm

Instead of using 2 loops.. we can just add a check condition in the first loop.. if the loop variable id equal to i then no multiplication will be done.. for(i=0;i<n;i++) { for(j=0;j<n;j++) { if(j!=i) k= k * a[j]; } o[i]= k; k=1;

context