Got it working, thanks for your help.
Here is my code
edit: woops didnt really change some of my comments...Code:#include <iostream> using namespace std; int main() { int num[10]; bool is_dup; cout << "Enter 10 numbers..." <<endl; for (int i=0; i<10; i++) { cin >> num[i]; } for (int j=0; j<10;j++) { is_dup= false; for (int k=j+1; k<10; k++) //this will repeat from j-1 to 0 { if (num[j] == num[k]) //checks if one number is equal to others below it is_dup = true; //You found a duplicate } if (is_dup == false) cout << num[j] << " "; } cout << endl; return 0; }




Reply With Quote