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
Write the Program to reverse a string using pointers.
Explain how do you convert strings to numbers in c?
What is typedef example?
What are the types of assignment statements?
What is bubble sort technique in c?
What is the code for 3 questions and answer check in VisualBasic.Net?
List the variables are used for writing doubly linked list program.
What are formal parameters?
What does struct node * mean?
Write a program to swap two numbers without using the third variable?
What is the advantage of c?
Badboy is defined who has ALL the following properties: Does not have a girlfriend and is not married. He is not more than 23 years old. The middle name should be "Singh" The last name should have more than 4 characters. The character 'a' should appear in the last name at least two times. The name of one of his brothers should be "Ram" Write a method: boolean isBadBoy(boolean hasGirlFriend , boolean isMarried, int age , String middleName , String lastName , String[] brotherName); isHaveGirlFriend is true if the person has a girlfriend isMarried is true if the person is married age is the age of the person middleName is the middle name of the person lastName is the last name of the person brotherName is the array of the names of his brothers
Differentiate between functions getch() and getche().
What is the function of this pointer?
What is pre-emptive data structure and explain it with example?