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
Why is c not oop?
Why functions are used in c?
how to find anagram without using string functions using only loops in c programming
Why we use stdio h in c?
Is that possible to store 32768 in an int data type variable?
Combinations of fibanocci prime series
Which is best linux os?
What are the types of data structures in c?
What is quick sort in c?
What library is sizeof in c?
What is null pointer constant?
Why clrscr is used after variable declaration?
program to convert a integer to string in c language'
What is nested structure with example?
Explain the use of 'auto' keyword