+ 3
How to search the. Elements of array of 10 elements
I'm confused plz help me
1 Antwort
+ 8
E.g.
int array[10] = {4, 5, 2, 6, 7, 9, 8, 0, 3, 1};
int search_key = 3;
for (int i = 0; i < 10; i++)
if (array[i] == search_key)
std::cout << "Array element found at index " << i;