friend, I am trying a programme with that takes tree arrays of same even lengths and adds the values at odd indexes and save at even index of 3rd array and voice virsa........
what will be the logic i have tried it a lot of time not worked................
Hi, i got a logic for you but i will not show you a logic. Follow below simple logic.
1. Initialize all arrays by zero in order to avoid junk/garbage value using while/for looping structures.
2. Take inputs in all arrays and make a check so that array size don't get odd i.e. user don't enter odd no of inputs. If so, force user to give more input of neglect most recent input to make the. array of even no's. Also generate a warning message about it.[ just for good programming practice :L ]
3. Start a loop while/for anyone which suits yourself. Also add relative elements.
for (initialization ; condition; iteration)
4. Also in above loop use 'if' to place values of SUM onto odd indexes of third array.
ok,that the code
cout<<"Enter Value for indux("<<i<<") of Arrays a,b";
cout<<"\nThe Value at indux("<<i<<") of Arrays a is ="<<a[i]<<"\nThe Value at indux("<<i<<") of Arrays b is ="<<b[i];
cout<<"\nThe Value at index ("<<j<<") of Array c is ="<<c[j];