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];
}
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.