Subtraction of two numbers using C

Question - 
Given two numbers , your task is to subtract first from second.
Example - 
Input : 2, 35
Output : sum is : -33
Input : 45,10
Output : sum is : 35

Approach - 
we solve this question with the help of basic maths.

Implementation -
#include <stdio.h>

int main()
{
    int num1,num2,sub;
    printf("Enter first integer numbers : ");
    scanf("%d",&num1);
    printf("Enter second integer numbers : ");
    scanf("%d",&num2);
    sub=num1-num2;
    
    printf("Sub is : %d",sub);

    return 0;
}

Comments