Input
Output
#include <iostream> using namespace std; int main() { int a[25] ={2,6,8,3}, search = 6, size = 4, i; cout << "Enter number of elements in array: " << size << endl; cout << "Enter the integers: "; for (i = 0; i < size; i++) { cout << a[i] << " "; } cout << "\nEnter the number to search: "; cout << search << endl; for (i = 0; i < size; i++) { if (a[i] == search) { cout << search << " is present in the array."; break; } } if (i == size) { cout << search << " is n't present in the array."; } return 0; }