vector fin element c++

#include <iostream>
#include <vector>

int main() {
    // Declare a vector of integers named 'numbers'
    std::vector<int> numbers = {10, 20, 30, 40, 50};

    // Find the iterator pointing to the first occurrence of the value 30 in the vector
    auto it = std::find(numbers.begin(), numbers.end(), 30);

    // Check if the element was found
    if (it != numbers.end()) {
        // Calculate the index of the found element
        int index = std::distance(numbers.begin(), it);

        // Print the index of the found element
        std::cout << "Element 30 found at index: " << index << std::endl;
    } else {
        // Print a message indicating that the element was not found
        std::cout << "Element 30 not found in the vector." << std::endl;
    }

    return 0;
}