What is error in the code below
Hi @kailash_01
In your code when you are using int k=sizeof(a)/sizeof(int); k comes out to be 10 when there are 5 elements, so instead of using k you can pass n as argument. Also in the sumpair function no need to print *l and *r. Also in the while loop when *l+*r<t then you enter into else case and print wrong answer, so for that you have to include another else if condition in which you do l++. And lastly in the output format βandβ should be in small letter and there should be space between *l and βandβ and *r.
Here is your corrected code :
If your doubt is clear then mark it as resolved.