> numbers[i]=j;

this should be numbs[i] = j;

You were trying to read from an array in which you didn't assign anything, that's why you got messed up output.

Here's the working program

Code:

#include <iostream>
using namespace std;
int linearSearch(const int array[], int key, int size){
for (int n=0; n<size; n++){
if(array[n]==key){
return array[n];
n++;
}
}
return -1;
}
int main(int argc, char* argv[]){
const int size=20;
int numbers[size];
int numbs[size];
int i,j;
for(i=0; i<size; i++){
cout<<"Enter a number: ";
cin>>numbers[i];
}
cout <<"Here is your array: \n";
for(i=0; i<size; i++){
cout<<numbers[i]<<" ";
}
cout <<"\nHere are your nonrepeating numbers:\n";
for(i=0;i<size;i++){
j=linearSearch(numbers,i,size);
if (j!=-1){
numbs[i]=j;
cout <<numbs[i]<<" ";
}
}
return 0;
}

-Prelude