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
write a program to generate address labels using structures?
What is c value paradox explain?
When should we use pointers in a c program?
How reliable are floating-point comparisons?
What is the general form of a C program?
What is the best way of making my program efficient?
What is the right way to use errno?
Give the rules for variable declaration?
How to explain the final year project as a fresher please answer with sample project
Why is %d used in c?
.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }
void main(int n) { if(n==0) return; main(--n); printf("%d ",n); getch(); } how it work and what will be its output...............it any one know ans plz reply
What 'lex' does?
How important is structure in life?
Explain the concept and use of type void.