Question: #include int number1; int number2; int number3; int maximum(int x, int y, int z) { int max = x; if (y > max) { max

  1. #include

    int number1;

    int number2;

    int number3;

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

    {

    int max = x;

    if (y > max)

    {

    max = y;

    }

    if (z > max)

    {

    max = z;

    }

    return max;

    }

    int main(void)

    {

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

    printf("Enter three integers: ");

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

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

    }

    1. Look for the scanf function that you have inside your main function. Modify this so instead of reading %d%d%d reads %i%i%i like this: scanf("%i%i%i", &number1, &number2, &number3);. Save these changes, compile it and run it. Make sure to enter positive and negative numbers. What happens?
    2. Now change this %i%i%i to %f%f%f like this: scanf("%f%f%f", &number1, &number2, &number3);. Save these changes, compile it and run it. Make sure to enter positive, negative and even decimal numbers. What happens?
    3. What does %d mean inside scanf?
    4. What does %i mean inside scanf?
    5. What does %f mean inside scanf?
    6. Now change all the integers (int) in your program for float

Save it, compile it and run it. Make sure to enter positive, negative and decimal numbers. What happens?

  1. Explain what happened when you changed int for float.

will upvote. thank you

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!