View the step-by-step solution to:

all the output from the following segment of program as it would appear on the screen. (10 points) Lines 1, 2, and 3 are called function...

  1. all the output from the following segment of program as it would appear on the screen. (10 points)
  2. Lines 1, 2, and 3 are called function ____________. The function __________ are in lines 17-31. (2 points)
  3. tell what int =5 means in line 2. (2 points)
  4. tell the significance of the & in line 3. (2 points)
  5. tell what the word static means in line 23. (2 points)
  6. tell the difference between line 10 and line 13. (2 points)


 

  1. int fa();
  2. void fb(int = 5);
  3. float fc(int &);
  4. int main()
  5. {
  6.   int x = 5, y;
  7.   float z;
  8.   y = fa();
  9.    cout << "y: " << y << endl;
  10.    fb();
  11.   z = fc(x);
  12.    cout << "z: " << z << endl;
  13.    fb(x);
  14.    cout << "x: " << x << endl;
  15.   return 0;
  16. }
  17. int fa() {
  18.   int x = 1;
  19.   x += 5;
  20.   return x;
  21. }
  22. void fb(int y) {
  23.   static int x = 4;
  24.   x -= y;
  25.   cout << "x:" << x * x << endl;
  26. }
  27. float fc(int & x) {
  28.   x += 2;
  29.   cout << "x:" << x << endl;
  30.   return 3.14;
  31. }

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question