C++ Download the attached program and complete the functions. (Refer to comments) main.cpp ~ #include #include #define END_OF_LIST -999 using...

50.1K

Verified Solution

Question

Programming

C++

Download the attached program and complete the functions. (Referto comments)

main.cpp ~#include #include #define END_OF_LIST -999using namespace std;/* * */int exercise_1() {  int x = 100;   int *ptr;     // Assign the pointer variable, ptr, to the address of x. Then print out   // the 'value' of x and the 'address' of x.  (See Program 10-2)     return 0; }int exercise_2() {  int x = 100;   int *ptr;     // Assign ptr to the address of x. Then use indirection to print out the   // value of x using pointer variable. (See Program 10-3)     return 0;}int exercise_3() {  int a[] = {1,2,3,4,5,6,7,8,9};  int *n;     // Print the address of the array a,     // Notice that printing the address of an array is different then printing  // the address of a variable.     // Assign the address of the array to the variable n. Then de-reference n   // to print out the first, third and fifth elements. (See Programs 10-5 and   // 10-6)   return 0;}int exercise_4() {  int a[] = {1,2,3,4,5,6,7,8,9};  int *n;      // Assign the address of the array to the variable n. Then use a loop to   // print out each element using a while loop (See Program 10-9)   for (int i=0; i<9; i++) {    cout << \"Element \" << i << \" is \" << \"... \" << endl;  }  return 0;}int main() {  exercise_1();  exercise_2();  exercise_3();  exercise_4();}

Answer & Explanation Solved by verified expert
4.0 Ratings (538 Votes)
include define ENDOFLIST 999 using    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students