Https://ide.codingblocks.com/s/63101

https://ide.codingblocks.com/s/63101
question https://hack.codingblocks.com/contests/c/452/875
sample test case gives correct answer but test cases are not passes plz help

Hi Aastha, you’re using n as the index. But it is not necessary that n will always be in a sequential order. It can also be like 1 3 5… So, we will use another variable i as the index. Rest of the computation logic is correct. I’ve modified this code, and you can refer to it here https://ide.codingblocks.com/s/63758

thanks its done now:smile: