#include <iostream>
using namespace std;
int main() {
int SIZE;
cout << "Enter the size of an array\n";
cin >> SIZE;
int array[SIZE];
for (int i = 0 ; i < SIZE ; i ++)
{
array[i] = i*i;
}
for (int i = 0 ; i < SIZE ; i ++)
{
cout << array[i] << endl;
}
// Array as pointer
cout << "&SIZE address " << &SIZE << endl;
cout << "Address of first element " << array << endl;
cout << "Address of last element " << (array + SIZE - 1 ) << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgU0laRTsKCQoJY291dCA8PCAiRW50ZXIgdGhlIHNpemUgb2YgYW4gYXJyYXlcbiI7CgljaW4gPj4gU0laRTsKCQoJaW50IGFycmF5W1NJWkVdOwoJCglmb3IgKGludCBpID0gMCA7IGkgPCBTSVpFIDsgaSArKykKCXsKCQlhcnJheVtpXSA9IGkqaTsKCX0KCQoJZm9yIChpbnQgaSA9IDAgOyBpIDwgU0laRSA7IGkgKyspCgl7CgkJY291dCA8PCBhcnJheVtpXSA8PCBlbmRsOwoJfQoJCgkvLyBBcnJheSBhcyBwb2ludGVyCgljb3V0IDw8ICImU0laRSBhZGRyZXNzICIgPDwgJlNJWkUgPDwgZW5kbDsKCWNvdXQgPDwgIkFkZHJlc3Mgb2YgZmlyc3QgZWxlbWVudCAiIDw8IGFycmF5IDw8IGVuZGw7Cgljb3V0IDw8ICJBZGRyZXNzIG9mIGxhc3QgZWxlbWVudCAiIDw8IChhcnJheSArIFNJWkUgLSAxICkgPDwgZW5kbDsKCXJldHVybiAwOwp9