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
When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd
Why doesnt that code work?
Where are the auto variables stored?
Multiply an Integer Number by 2 Without Using Multiplication Operator
What is the role of && operator in a program code?
What does typedef struct mean?
When the macros gets expanded?
how do you execute a c program in unix.
What is the use of #include in c?
will u please send me the placement papers to my mail???????????????????
Write a program of advanced Fibonacci series.
There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?
while initialization of array why we use a[][2] why not a[2][]...?
Explain the ternary tree?
Can math operations be performed on a void pointer?