b) Trace the output for the following program. [Note: show the value changes in the memory and your working steps in void funl (int *p, int *q) { int r; printf("\n p = %d, q = %d", *p, *q); r=*p; *p = *q; 1 = b, printf("\nr = %d, p = %d, q = %d", r, *p, *q) ; %3D int fun2 (int s) return s = s + 5; void main () { int varl = 5, var2 = var2 = var2 / 2; printf (" Varl = %d, Var2 = %d", varl++, var2); funl (&varl, & var2); printf("\n Varl = %d, Var2 = %d", var1, var2); printf ("\n Var3 = %d", fun2 (++var3)); 200, var3 = 50; %3! %3D

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter4: Selection Structures
Section4.1: Selection Criteria
Problem 2E
icon
Related questions
Question

i have trouble answering this 

b) Trace the output for the following program.
[Note: show the value changes in the memory and your working steps in de
void funl (int *p, int *q)
{
int r;
printf ("\n p = %d, q = %d", *p, *q) ;
r=*p;
*p = *q;
printf ("\n r = %d, p = %d, q = %d", r, *p, *q);
1I = b,
int fun2 (int s)
{
return s = s + 5;
}
void main ()
{
int varl = 5, var2 = 200, var3
var2 = var2/ 2;
printf(" Varl = %d, Var2 = %d", varl++, var2);
funl (&varl, & var2);
printf ("\n Varl = %d, Var2 = %d", varl, var2);
printf ("\n Var3 = %d", fun2 (++var3));
50;
%3D
%3D
Transcribed Image Text:b) Trace the output for the following program. [Note: show the value changes in the memory and your working steps in de void funl (int *p, int *q) { int r; printf ("\n p = %d, q = %d", *p, *q) ; r=*p; *p = *q; printf ("\n r = %d, p = %d, q = %d", r, *p, *q); 1I = b, int fun2 (int s) { return s = s + 5; } void main () { int varl = 5, var2 = 200, var3 var2 = var2/ 2; printf(" Varl = %d, Var2 = %d", varl++, var2); funl (&varl, & var2); printf ("\n Varl = %d, Var2 = %d", varl, var2); printf ("\n Var3 = %d", fun2 (++var3)); 50; %3D %3D
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Print statement
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning