Pergunta de entrevista da empresa Dimentrix

Take 1 array compile time.. e.g. a[]={2,6,4,9,10}; then add adjacent elements of array and get new array. using above example we get b[]={8,10,13,19}; now in that new array.. find out maximum value and print that value. and also print two indices of elements in original array whose addition is maximum. Conditions: 1.DON'T TAKE INPUT FROM USER. 2.YOU CAN USE ONLY ONE LOOP ALSO ONLY ONCE.. DON'T USE NESTED LOOP 3. YOU CAN TRAVERSE ORIGINAL ARRAY ONLY ONCE.