Answer to Question #262887 in C for Mr Z

Question #262887

5.3

Enter the code

void blah(int i)
{
    printf("In function: the value of i is %d\n", i);
    i++;
    printf("In function: the value of i after increment is %d\n\n", i);
}


int main(int argc, char *argv[]) {
    int num;
    
    num = 3;
    blah(num);
    
    printf("In main(): the value of num is %d\n", num);

    system("pause");
	return 0;
}


• Write a short reflective account of the code concentrating on its functionality and comparing the outputs against the source code.


1
Expert's answer
2021-11-08T11:29:12-0500


#include <stdio.h>


//declare a fuction blah that takes a argument i
void blah(int i)
{
    //display the value of i before increment
    printf("In function: the value of i is %d\n", i);
    i++;
    //display the value of i after increment
    printf("In function: the value of i after increment is %d\n\n", i);
}




int main(int argc, char *argv[]) {
    //declare a variable named num;
    int num;
    //initialize num to 3
    num = 3;
    //call the function blah and pass the value of num to it
    blah(num);
    //display the value of num
    printf("In main(): the value of num is %d\n", num);


    // system("pause");
	return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS