Answer Posted / supri
see subtraction itself is the addition of the number with
its 2's complement....
add(int a,int b)
{
if(!a)
return b;
else
return(add((a&b)<<1,a^b));
}
main()
{
int a,b;
scanf("%d%d",&a,&b);
b=add(~b,1);
printf("%d",add(a,b));
return;
}
u can try this...
Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is this pointer in c plus plus?
How do shell structures work?
program for reversing a selected line word by word when multiple lines are given without using strrev
What is the meaning of 2d in c?
c program to compute AREA under integral
Why is c used in embedded systems?
What is function prototype in c with example?
#include
What is integer constants?
What is meant by preprocessor in c?
Explain how do you convert strings to numbers in c?
How many types of arrays are there in c?
What is the use of parallelize in spark?
What are structural members?
What does %c do in c?