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 the significance of scope resolution operator?
Discuss the function of conditional operator, size of operator and comma operator with examples.
Write a c program to build a heap method using Pointer to function and pointer to structure ?
Explain a pre-processor and its advantages.
Write a program to show the change in position of a cursor using c
swap 2 numbers without using third variable?
What are extern variables in c?
can we have joblib in a proc ?
What is the difference between #include
HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????
What is the meaning of typedef struct in c?
Explain logical errors? Compare with syntax errors.
How important is structure in life?
What is the difference between the local variable and global variable in c?
How is a pointer variable declared?