c++ lambda as variable

#include <iostream>

int main() {
    // Step 1: Declare a lambda function and assign it to a variable.
    auto add = [](int a, int b) {
        return a + b;
    };

    // Step 2: Use the lambda variable as a function.
    int result = add(3, 4);

    // Step 3: Print the result.
    std::cout << "Result: " << result << std::endl;

    return 0;
}