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 |
Suppose we have a table name EMP as below. We want to perform a operation in which, I want to change name ‘SMITH’ from as ‘SMITH JAIN’. Also I want to change the name of the column from ENAME to E_NAME. EMPNO ENAME JOB MGR HIREDATE SAL 7369 SMITH Coder 7902 17-DEC-80 800 7499 ALLEN SALESMAN 7698 20-FEB-81 1600 7521 WARD SALESMAN 7698 22-FEB-81 1250
Explain how can you avoid including a header more than once?
What are the primitive data types in c?
Write a function stroverlap that takes (at least) two strings, and concatenates them, but does not duplicate any overlap. You only need to worry about overlaps between the end of the first string and the beginning of the second string. Examples: batman, manonthemoon = batmanonthemoon batmmamaman, mamamanonthemoon = batmmamamanonthemoon bat, man = batman batman, batman = batman batman, menonthemoon = batmanmenonthemoon
A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference
What is the use of function overloading in C?
What is Bitwise Operator and how it works?
What is the difference between fread and fwrite function?
What is the benefit of using const for declaring constants?
what is the difference between. system call and library function?
can any one tel me wt is the question pattern for NIC exam
What ios diff. Between %e & %f?