#include<iostream.h>
#include<conio.h>
void main()
{
int a[10],i,item,flag=-1;
cout<<"enter the elements of an array";
for(i=0;i<=9;i++)
cin>>a[i];
cout<<"enter the element to be search";
cin>>item;
for(i=0;i<=9;i++)
if(item==a[i])
{
flag=1;
break;
}
if(flag==-1)
cout<<"search unsucessfull";
else
{
cout<<"search sucessfull";
}
getch();
}

Did you write this code? Besides the fact that there is no formating and it is mostly not standard compliant what is the issue?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.