Arrays-Target Sum Triplets

Take as input N, the size of array. Take N more inputs and store that in an array. Take as input “target”, a number. Write a function which prints all triplets of numbers which sum to target.

Input Format
First line contains input N.
Next line contains N space separated integers denoting the elements of the array.
The third line contains a single integer T denoting the target element.

see my code and please tell me ehat is the mistake in the code and please correct that too

hello @dhruvk3k
shared ur updated code in the chat pls check