Given the following code:

            for (int i=0; i < values.length; i++) {
              if (values[i] == searchedValue){
                found = true; 
              } else {
                found = false;
              }
            } 
            if (found) { 
              System.out.println("found " + searchedValue); 
            } else { 
              System.out.println ("not found"); 
            }      
        
If the initital values are:
          int[] values = { 3, 6, 10, 12, 100, 200, 250, 500 };
          int searchedValue = 500;
          boolean found = false;
      
What is output?

found 500
  • not found

There are no hints for this question