Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#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

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

Recommended Textbook for

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions

Question

Heat and mass transfer

Answered: 1 week ago

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago