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 static is used in c?
Do you know what are bitwise shift operators in c programming?
write a c programming using command line argument,demonstrate set operation(eg;union,intersection,difference) example output is c:>setop 12 34 45 1 union 34 42 66 c:>setop 12 34 1 42 66 c:>setop 12 34 diff 12 56 67 78 setop 12 34
Why doesnt this code work?
How can I find the modification date and time of a file?
What is a double c?
Given a valid 24 hour format time find the combination of the value and write a program ,do not hard the value and if any other inputs provided should work with the logic implemented Input: 11:30 Output: 13:10 Input: 18:25 Output: 21:58
What are the data types present in c?
how to write a c program to print list of fruits in alpabetical order?
Who invented b language?
What is meant by type casting?
Is int a keyword in c?
what do you mean by inline function in C?
Can a file other than a .h file be included with #include?
What does %p mean c?