#include using namespace std; int main () { int* a = NULL; a = new(nothrow) int; if (!a) cout << "allocation of memory failed\n"; else { *a = 20; cout << "Value of a: " << *a << endl; } float *b = new float(23.14); cout << "Value of b: " << *b << endl; int n = 6; int *q = new(nothrow) int[n]; if (!q) cout << "allocation of memory failed\n"; else { for (int i = 0; i < n; i++) q[i] = i+1; cout << "Value store in block of memory: "; for (int i = 0; i < n; i++) cout << q[i] << " "; } delete a; delete b; delete[] q; return 0; }