You are on page 1of 1

#include<conio.

h>
#include<iostream>
using namespace std;
int main()
{
int arr[10],sr,j;
bool check=false;
for(j=0;j<=9;j++)
{
cout<<endl<<"Enter value for"<<j<<"Location";
cin>>arr[j];
}
cout<<endl<<"Enter number to search";
cin>>sr;
for(j=0;j<=9;j++)
{
if(sr==arr[j])
{
cout<<"congratulation!!!"<<endl;
cout<<"Value found at"<<j<<"Loction";
check=true;
}
}
if(check==false)
cout<<endl<<"Invalid Number";
getch();
return 0;
}

You might also like