This code you are asked to input a number and it will tell u wheter or not the input you entered is in the array or not
i am having issues with this code and its giving me some errors,
if anyone wants to help me out it will be greatly appreciated!
include <iostream>
using namespace std;
int search(int a[], int size, int searchKey);
int main()
{
int small, a[]= {10, 15, 27, 89, 90, 95, 27, 13, 99, 33};
const int size = 10;
int i;
int target;
int searchKey;
cout << "Enter a number to be found: ";
cin >> target;
if(a[i] == target)
cout <<"Number found" ;
else
cout <<"Number not found in the array" << endl;
return 0;
int search(int a[], int size, int searchKey)
{
{
int i;
int target;
for(a[i] = 0; i < size; i++)
{
if(a[i] == target)
return i;
}
else return 0;
}
}