} Driver Code Ends
| 5 | |
| 6 | // } Driver Code Ends |
| 7 | class Solution{ |
| 8 | public: |
| 9 | // Function to search x in arr |
| 10 | // arr: input array |
| 11 | // X: element to be searched for |
| 12 | int search(int arr[], int N, int X) |
| 13 | { |
| 14 | for(int i=0;i<N;i++){ |
| 15 | if(arr[i]==X){ |
| 16 | return i; |
| 17 | } |
| 18 | } |
| 19 | return -1; |
| 20 | // Your code here |
| 21 | |
| 22 | } |
| 23 | |
| 24 | }; |
| 25 | |
| 26 | // { Driver Code Starts. |
| 27 |
nothing calls this directly
no outgoing calls
no test coverage detected