Find Minimum Value

PHOTO EMBED

Thu Jun 06 2024 05:51:03 GMT+0000 (Coordinated Universal Time)

Saved by @meanaspotato #c

#include <stdio.h>

int identify_minimum_value(int input_1, int input_2)
{
    int minimum_value;
    
    if(input_1<input_2)
    {
        minimum_value = input_1;
    }
    else
    {
        minimum_value = input_2;
    }
    
    return minimum_value;
}

int main (void)
{
    int input_1;
    int input_2;
    printf("Please input number 1:\n");
    scanf("%d",&input_1);
    printf("Please input number 2:\n");
    scanf("%d",&input_2);
   int minimum_value = identify_minimum_value(input_1,input_2);
    
    printf("The minimum number of %d and %d is %d",input_1,input_2,minimum_value);
    return 0;
}
content_copyCOPY

Objective: Develop a program that determines and displays the smaller of two integers inputted by the user. Guidelines: Function Declaration & Definition: Create a function named identify_minimum_value. The function should take in two integer parameters. Return the lesser of the two integer inputs. Ensure the function has no side effects: it should not print or take any input. Main Program Execution: Within the main() function: Request the user to input two integers. Call the identify_minimum_value function with the user's integers as arguments. Save the returned value in a variable named minimum_value. Display the minimum_value to the user.