4. Show the output of the following program as it would appear on the screen. 20
ID: 3802231 • Letter: 4
Question
4. Show the output of the following program as it would appear on the screen. 20 points) R program written by A. Bright Student #include stdio.h int M 15; int N 20; int main(void) void Louie( int, int); int a,b; a 10; b 35; prin ("%s %d %dln"," In Main", a,b); Louie(a,b); print ("Back from Louie %d %dln",a, b); printf(" values %3d,%3d, areln", M,N); return 0; void Louie( int V, int W) int total; printf" In Louieln"); total V+ W; print ("%dln", V; printf( "%dln", W; M 412; total) print total is now %3dln",Explanation / Answer
Ans a) a and b variables are LOCAL to main. becuase they are declared and defined in the main function only and they have limited scope.
ans b) M and N variables are GLOBAL to main. because they are declared outside the main function. they have scope limited to that file. so they are accessible by any function.
ans c) X a is an input parameter, b is an input value parameter.
because, a and b parameters are local and getting passed into Louie function. then those values will be copied into variables V and W.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.