# Program to subtract two numbers using functions

## Problem Statement:- Program for the subtraction of two numbers using functions.

#### Sample Input/Output:-

 Sample Input First:84 Sample Output First: 4 Sample Input Second: 50200 Sample Output Second: -150

#### Data requirement:-

Input Data:- num1, num2

Output Data:-sub

Program in C

Code:

Program in C++

## Here is the source code of the C++ Program to subtract two numbers using functions.

Code:

### ``import java.util.Scanner;public class SubtractionOfTwoNumbers {    /* This function calculating subtraction of two numbers. */    static int subTwoNumbers(int num1, int num2) {        /*         * Calculating the subtraction of two numbers and store into minus variables         */        int minus = num1 - num2;        return minus;    }    public static void main(String[] args) {        Scanner sc = new Scanner(System.in);        int num1, num2;        /* Get the input of two variables */        System.out.print("Enter the Two Numbers:");        num1 = sc.nextInt();        num2 = sc.nextInt();        /* Call Function subtraction_two_numbers with two Parameters */        int sub = subTwoNumbers(num1, num2);        /* Display subtraction of two numbers */        System.out.println("Subtraction of two Numbers is: " + sub);        sc.close();    }}``Input/Output:Enter the Two Numbers:356 989Subtraction of two Numbers is: -633

Program in Python

Code: