Answer to Question #276283 in C for Mr Z

Question #276283

5.4. Using the online compiler Enter the code:

#include <stdio.h>
#include <stdlib.h>

// Function prototype. Some compilers absolutely insist that function
// prototype(s) are present
void blah2(int *i);


// ===========================================================
// Function blah2()
//
// This takes a reference to a value i, increments it and displays it
//
// Returns the calculated voltage.
// ===========================================================

void blah2(int *i)
{
    printf("In function: the value of *i is %d\n", *i);
    (*i)++;  // Equivalent to *i = *i + 1;
    printf("In function: the value of *i after increment is %d\n\n", *i);
}


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

    system("pause");
	return 0;
}


• Run the program.


1
Expert's answer
2021-12-06T19:08:18-0500

The answer to your question is provided in the image:

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