"Write a program that reads in ten numbers to an array. The program then reads the array and displays distinct numbers (i.e. if a number appears multiple times, it is displayed only once)"
for example:
1 2 3 4 [B]5 5 [/B]6 7 [B]8 8[/B] 9
1 2 3 4 5 6 7 8 9
I am currently stuck in my program for about a couple of hours. So far, I can read in 10 numbers and print them out, but I don't know where to go from there. I'm not that experience at C++, so if someone can help me, I would appreciate it.
Here is my code:
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
double num[10];
cout<<"Enter ten numbers "<<endl;
cout<<""<<endl;
for(int i = 0; i<10; i++)
{
cin>>num[i];
}
cout<<""<<endl;
cout<<"The distinct numbers are "<<endl;
cout<<""<<endl;
system ("PAUSE");
return 0;
}