Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#include int maximum(int x, int y, int z); int main(void) { int number1; int number2; int number3; printf(Enter three integers: ); scanf(%d%d%d, &number1, &number2, &number3);

#include

int maximum(int x, int y, int z);

int main(void)

{

int number1;

int number2;

int number3;

printf("Enter three integers: ");

scanf("%d%d%d", &number1, &number2, &number3);

printf("Maximum is: %d ", maximum(number1, number2, number3));

}

int maximum(int x, int y, int z)

{

int max = x;

if (y > max)

{

max = y;

}

if (z > max)

{

max = z;

}

return max;

}

image text in transcribed

please help! will give good rating :)

Perform the following changes to the program and understand what happens: a) Take int maximum(int x, int y, int z); which at the beginning of the code, and place it inside main function, just after the declaration of the variables, like, int main(void) { int number1; int number2; int number3; int maximum int x, int y, int z); b) Save the program, compile it and run it. What happened to your program? c) Why do you think this happened? d) Place a couple of forward slash (//) before this int maximum int x, int y, int z); you moved inside the main function, like this //int maximum(int x, int y, int z);. These will make this a comment, so the program will not read it when you compile it and read it. Now, save it, compile it, and run it. What happened? Explain why this is happening? Note: Do not revert this change and continue to the next step. e) Move your maximum function before the main function, just after you #include . Save this change, compile it and run it. What happened

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

1. Explain why evaluation is important.

Answered: 1 week ago