Subtraction of Two Numbers In C-Programming - Learn Engineering

All the news and updates relevant to Engineering. You can also Write a post here

Breaking

Saturday, May 16, 2020

Subtraction of Two Numbers In C-Programming


Today we are going to learn about the Subtraction of Two Numbers(Integer Value) Using C-Programming.

Testcase Input: 5 10                                                   Expected-Output: -5

#include<stdio.h>
int main ( )
{
    int num1, num2, sub=0 ;
    scanf("%d %d" , &num1 , &num2) ;
    sub = num1 - num2 ;
    printf ( "%d" , sub );
    return 0;
}

Result: 

-5

Comment your Queries,

1 comment: