Problem

What is the output of the following program? (You may need to consult the ASCII table i...

What is the output of the following program? (You may need to consult the ASCII

table in Appendix A.)

#include <iostream>

using namespace std;

// Function prototypes

void fillArray(char [], int)

void showArray(const char [], int)

int main ()

{ char prodCode[8] = {'0', '0', '0', '0', '0', '0', '0', '0'};

fillArray(prodCode,8);

showArray(prodCode,8);

return 0;

}

// Definition of function fillArray

// (Hint: 65 is the ASCII code for 'A'.)

void fillArray(char arr[], int size)

{ char code = 65;

for (int k = 0; k < size; code++, k++)

arr[k] = code;

}

// Definition of function showArray

void showArray(const char codes[], int size)

{ for (int k = 0; k < size; k++)

cout << codes[k];

}

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT