Dynamic Integer Allocation

#include <iostream>
using namespace std;

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

    // Write your dynamic allocation code here
    int *t = new int(x);
    cout << *t ;
    delete t;

    return 0;
}

Syntax

 

 

 

 

 

Upvote
Downvote
Loading...

Input

42

Expected Output

42