Module: Linear and binary search for elements in an array


Problem

5/7

Linear search - 3 Early exit from the loop

Theory Click to read/hide

Another approach to solving this problem is possible. You can use an early exit from the loop if the required value is found. 
In C++, the break statement is used to break out of a loop;

Problem

In the given array, you need to find the value of the element equal to the value XX is entered from the keyboard. from scratch.

If there is no such element, the program should output Not found.