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
Array is an lvalue or not?
Explain the use of keyword 'register' with respect to variables.
can anyone suggest some site name..where i can get some good data structure puzzles???
Discuss the function of conditional operator, size of operator and comma operator with examples.
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create.
What is difference between scanf and gets?
What is a null pointer in c?
Place the #include statement must be written in the program?
What are volatile variables in c?
Differentiate between full, complete & perfect binary trees.
The file stdio.h, what does it contain?
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream
How can type-insensitive macros be created?
Hi can anyone tell what is a start up code?
What is an expression?