Dynamic Integer Allocation

#include <iostream>
using namespace std;

int main() {
    int x;
    cin >> x;
    int *p = new int (x);
    cout << *p;
    delete p;
    // Write your dynamic allocation code here

    return 0;
}

Solving Approach

 

 

 

 

 

Upvote
Downvote
Loading...

Input

42

Expected Output

42