q.Use a one-dimensional array to solve the following problem. Read in 20 numbers, each of which is between 10 and 100, inclusive. As each number is read, validate it and store it in the array only if it is not a duplicate of a number already read. After reading all the values, display only the unique values that the user entered.
code is
#include <iostream>
using namespace std;
void main()
{
int i,q,counter=0,j,w=0;
int a[10];
for( i=0;i<10;i++)
{
cout<<"enter 10 numbers";
cin>>q;
if(q>=10&&q<=100){
for( j=0;j<10;j++)
if(q==a[j])
{
counter++;
break;
}
if(counter==0){
a[w]=q;
w++;
}}
else
{
cout<<"you enter low or high number"<<endl;
cout<<"enter again"<<endl;
cin>>q;
}
}
for(int e=0;e<w;e++)
cout<<a[e]<<endl;
}
problem is that it is not showing the write output please help me in this program.