is the code that i have written i am unable to find the problem in the code please help me out.
Test cases not passing
You were printing the unnecessary lines in 16 to 18 lines of your code.
I also corrected your loop ,please see https://ide.codingblocks.com/s/190492
how to solve by using two loops
since you know the first 2 elements from iterating you can binary search the third element, it should be target - a[i] - a[j].