Hi my interviewer said that if i can solve this problem he will get me a job he asked me: 'creates an integer array of size N, containing integers with values from 0 to N - 1, all different from eachother and prints them on the screen'

so i have no idea what he was talking about but i tried to come up with a program like this but had 8 errors of being illegal star of expression needed ] etc.:

Code :

public class recklesspk { public static void main(String[] args) { int a[N]; // This is the input int products_below[N]; p=1; for(int i=0;i<N;++i) { products_below[i]=p; p*=a[i]; } int products_above[N]; p=1; for(int i=N-1;i>=0;--i) { products_above[i]=p; p*=a[i]; } int products[N]; // This is the result for(int i=0;i<N;++i) { products[i]=products_below[i]*products_above[i]; } } }