Add elements in the second half sum
else sumsecond += arr [ i ] ; } cout << " Sum ▁ of ▁ first ▁ half ▁ elements ▁ is ▁ " << sumfirst << endl ; cout << " Sum ▁ of ▁ second ▁ half ▁ elements ▁ is ▁ " << sumsecond << endl ; }