#include<iostream>
#include<conio.h>
using namespace std;
main()
{
int arr[10]={10,20,30,40,50,60,70,80,90,100};
int n, loc=-1;
cout<<"Enter element to be search ";
cin>>n;
for(int a=0; a<n; a++)
{
if(n=arr[a])
loc=a;}
if(loc==-1)
cout<<" VAlue not found";
else
cout<<" Value found at array "<<loc;
}
No comments:
Post a Comment