Basic concept of lambda and closure

·

1 min read

int main(){
    int totalRows;
    cin>> totalRows;
    int currentRow=1;
    while(currentRow<=totalRows) {
        int coloumn=1;
                    int number=currentRow;
            while (coloumn <=totalRows - currentRow) {
                cout << " " ;
                coloumn = coloumn + 1;
            }

            while(coloumn<=currentRow){
                cout<<number;
                number=number+1;
                coloumn = coloumn + 1;
            }
    cout<<endl;        
    currentRow=currentRow+1;        
    }

}

func decl and def in c++