elephants and candies

please check this out…i dont find anything wrong with my code.click on this text to view thanks in advance

Initialise sum to 0 for each test case so that you calculate sum of array values for each test case seperately. Look at the third test case in these programs … your original code and edited code.

@vinayawsm thanks mister…i wish i could give you a positive feedback but sorry i have less reputation…
.