[algogeeks] Re: Amazon - array problem

2011-09-30 Thread Abraham
Can we replace the operator (/) with 1^(-n) ? On Sep 30, 12:54 pm, raju nikutel...@gmail.com wrote: @nitin .. Output array is not a new array ... you can do anything to input array .. ~raju On Fri, Sep 30, 2011 at 1:24 PM, Nitin Garg nitin.garg.i...@gmail.comwrote: Can we assume

[algogeeks] Re: Amazon - array problem

2011-09-30 Thread Brijesh
int main() { int a[]={4,3,5,2,6}; // 1 4 12 60 120 const int n=5; int temp=1,i; int b[5]={0}; for(i=0;in;i++) { b[i]=temp; temp*=a[i]; } temp=1; for(i=n-1;i=0;i--) { b[i]*=temp; temp*=a[i];