Question:Write a c program or code to subtract two numbers without using subtraction operator 

Answer 
#include<stdio.h>

int main(){
   
    int a,b;
    int sum;

    printf("Enter any two integers: ");
    scanf("%d%d",&a,&b);

    sum = a + ~b + 1;

    printf("Difference of two integers: %d",sum);

    return 0;
}
Sample Output: Enter any two integers: 5 4 Difference of two integers: 1 

+ Report
Total Preview: 462
Write a c program or code to subtract two numbers without using subtraction operator
Copyright © 2024. Powered by Intellect Software Ltd