In: Computer Science
use cout to print the address at which the following array is stored in memory
long double computers[24]
a. print the adress of the last element
b. print the address of the tenth element.
c. print the address of the first element in the array
/* ADDRESS MAY BE DIFFERENT IN DIFFERENT COMPUTERS */
#include<iostream>
using namespace std;
int main(){
long double computers[24];
// in C++ array index starts from 0
// so index is from 0 to 23
cout << "Address of last element:
"<<&computers[23]<<endl;
cout << "Address of the tenth element:
"<<&computers[9]<<endl;
cout << "Address of the first element:
"<<&computers[0]<<endl;
return 0;
}
/* OUTPUT */
/* PLEASE UPVOTE */