C program to Subtract two integer numbers without using subtraction operator

Write a C program to Subtract two integer numbers without using subtraction operator ?


[c]

#include<stdio.h>

void main()

{

int a,b,d;

scanf("%d%d",&a,&b);

d=a+~b+1;

printf("%d",d);

}[/c]

Share

About the Author

Akash Padhiyar

Visit Website

One Comment

  1. good!! 🙂

Leave a Comment

Your email address will not be published. Required fields are marked *

*

Time limit is exhausted. Please reload CAPTCHA.