Just need a detailed explanation on how the answers were attained.

User Generated

fabbcl2005

Computer Science

Description

Parameters: What does the following program print?

 

#include <stdio.h>

void f1(int *a, int *b){

         *a += *b;

}

void f2(int *a, int *b){

         *a -= *b;

}

void f3(int *a, int *b){

          int i;

          for (i = 0; i < 3; i++) {

                 f1(a, b);

            printf( a= %i” , *a);

}}

 

void main () {

   int x =6;

   int y =2;

   int z =7;

   f2 (&x, &y);

   f3 (&x, &z);

   printf( “ \nx=%i, y=%i, z=%i” , x, y, z);

}


ANSWER IS:

a =11 a=18  a=25

x=25  y=2  z=7

User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer


Anonymous
I was struggling with this subject, and this helped me a ton!

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags