// C++ Program to search any element or number in an array
#include <iostream>
using namespace std;
int main(){
int input[100], count, i, num;
cout << "Enter Number of Elements in Array
";
cin >> count;
cout << "Enter " << count << " numbers
";
// Read array elements
for(i = 0; i < count; i++){
cin >> input[i];
}
cout << "Enter a number to serach in Array
";
cin >> num;
// search num in inputArray from index 0 to elementCount-1
for(i = 0; i < count; i++){
if(input[i] == num){
cout << "Element found at index " << i;
break;
}
}
if(i == count){
cout << "Element Not Present in Input Array
";
}
return 0;
}