It is showing compilation error kindly look into int it

import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int[] a = new int[N];
int i=0;
while(i<N){
a[i]=sc.nextInt();
}
int target = sc.nextInt();
for(int j = 0;j<N;j++){
for(int k = j+1;k<=N-1;k++){
if((a[j]+a[k])==target){
System.out.println(a[j]+β€œand”+a[k]);
}
}
}

}

}

you forgot to increment i each time taking input in the while (i<N) array
also you need spaces before and after and like a[j]+β€œ and ”+a[k] and you have to print the smaller of a[j] and a[k] first and then the latter
if this solves your doubt please mark it as resolved :slight_smile: