how to add two numbers without using arithmetic operators?
Answers were Sorted based on User's Feedback
Answer / sanjay bhosale
int x=12382,y=2;
int xor, and, temp;
and = x & y;
xor = x ^ y;
while(and != 0 )
{
and <<= 1;
temp = xor ^ and;
and &= xor;
xor = temp;
}
printf(" sum is : %d",xor);
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / shashishekar
#include<stdio.h>
#include<conio.h>
int main()
{
int a= 10;
int b=5;
int sum=0;
sum= a-(~b)-1;
printf(" sum= %d",sum);
getch();
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / mallikarjun
#include<stdio.h>
#include<conio.h>
main()
{
int a= 10;
int b=5;
sum=0;
sum= a&&b;
printf(" sum= %d",sum);
}
| Is This Answer Correct ? | 9 Yes | 10 No |
Answer / rajkumar
#include<stdio.h>
#include<conio.h>
void main()
{
int a=6,b=3,sum=0;
sum=a^b;
printf("sum=%d",sum);
getch();
}
| Is This Answer Correct ? | 3 Yes | 9 No |
Explain how can you determine the size of an allocated portion of memory?
What is the difference between union and anonymous union?
You have an array of n integers, randomly ordered with value 1 to n-1.The array is such that there is only one and one value occurred twice. How will you find this number?
Read N characters in to an array . Use functions to do all problems and pass the address of array to function. 1. Print only the alphabets . If in upper case print in lower case vice versa.
What is an example of structure?
What does sizeof function do?
Write a program that will read the input of any number of digits n in a row of shafh showing the breakdown of the printing and printing figures by the recursive function.
In a header file whether functions are declared or defined?
int *a[5] refers to
Why doesnt the call scanf work?
write a program that will print %d in the output screen??
The operation of a stair case switch best explains the a) or operation b) and operation c)exclusive nor operation d)exclusive or operation Which of the following is/are syntactically correct? a) for(); b) for(;); c) for(,); d) for(;;);
1 Answers HCL, Public Service Commission,