write a c program to add two integer numbers without using
arithmetic operator +
Answer Posted / maksim
a = 53;
int c = 0b10000000;
int d = c;
printf("c=%d\n",c);
s = 30;
while(c>0){
int d = c;
if (a&d){
while ((s&d)&&(d<=128)) {
s = (s&~d);
d = d<<1;
}
d = (d<=128)?d:0;
s = s|d;
}
c = c>>1;
}
printf("s=%d\n",s);
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
Difference between exit() and _exit() function?
main() { printf("hello"); fork(); }
Explain what are reserved words?
Q.1 write aprogram to stack using linklist o insert 40 items? Q.2 write a program to implement circular queue with help of linklist?
What is a lookup table in c?
Is c is a low level language?
What is gets() function?
why wipro wase
I just typed in this program, and it is acting strangely. Can you see anything wrong with it?
Where define directive used?
How does pointer work in c?
What’s the special use of UNIONS?
Is file a keyword in c?
What is a memory leak? How to avoid it?
What is masking?