# Find out the smallest of two numbers using function

## Problem Statement:-  Program to find a minimum number from given two numbers using a user-defined function.

#### Sample Input/Output:-

 Sample Input First:813 Sample Output First: 8 Sample Input Second: 325201 Sample Output Second: 201

#### Data requirement:-

Input Data:- num1, num2

Output Data:-min

Program in C

Code:

Program in C++

## Here is the source code of the C++ Program to find a minimum number from given two numbers using a user-defined function.

Code:

### ``import java.util.Scanner;public class FindMinimum {    /* This function find a minimum number from given two numbers. */    static int MinimumOfTwo(int num1, int num2) {        return (num1 < num2) ? num1 : num2;    }    public static void main(String[] args) {        Scanner sc = new Scanner(System.in);        /* Get the input of two variables */        System.out.println("Enter the Two Numbers:");        int num1 = sc.nextInt();        int num2 = sc.nextInt();        /* Call Function MinimumOfTwo with two Parameters */        int min = MinimumOfTwo(num1, num2);        /* Display smallest number between two numbers */        System.out.println("Minimum Number Between two Numbers is: " + min);        sc.close();    }}``Input/Output:Enter the Two Numbers:3320Minimum Number Between two Numbers is: 20

Program in Python

Code: