Quote:

Originally Posted by **blabla2028**
The code would be something like this I suppose:

[CODE]

int main()

{

int arr[n],OutVar[n2];

int counter1,counter2,result;

result=1;

for(counter1=0; counter1<n2; counter1++)

{

for(counter2=0; counter2<n; counter2++)

{

if counter2=counter1 continue;

result=result*arr[counter2];

}

OutVar[counter1]=result;

result=1;

}

}

[/QUOTE]

Nice Appreciated!!! But dear One thing Time complexity of your program is O(n2 *n) ~=O(sqr(n))

But you have to solve it in time O(n) i.e. Linear.