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
Why use int main instead of void main?
What is call by value in c?
How can this be legal c?
What should malloc(0) do?
How can I determine whether a machines byte order is big-endian or little-endian?
What are identifiers in c?
How to delete a node from linked list w/o using collectons?
Write a program to know whether the input number is an armstrong number.
What is the use of ?: Operator?
a construct the"else" part of "if" statement contains anoth "if else" statement is called a) if-else b) else-if-else c) if-else-if-else d) chain if/if-else-if
What are the application of void data type in c?
Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)
What are the advantages of c language?
What is s in c?
Is a pointer a kind of array?