Lambda Square Operation

#include <iostream>
using namespace std;

int main() {
    int n;
    cin >> n;

    auto square = [](int n){return n*n;};

    cout << "Square=" << square(n);
    return 0;
}

Solving Approach

 

 

 

Upvote
Downvote
Loading...

Input

5

Expected Output

Square=25