7. Examine the C program that follows: (a) Draw the run-time stack just after the procedure is...

Question:

7. Examine the C program that follows:

(a) Draw the run-time stack just after the procedure is called for the last time, including the stack frame for main().

(b) What is the output of the program?

#include

void what(char *word, int j) {

if (j > 1) {

word[j] = word[3 - j];

what(word, j - 1);

} // ra2

} int main() {

char str[5] = "abcd";

what(str, 3);

printf("%s", str); // ra1 return 0;

}

Step by Step Answer:

Related Book For  book-img-for-question

Computer Systems

ISBN: 9781284079630

5th Edition

Authors: J Stanley Warford

Question Posted: