how to add numbers without using arithmetic operators.
Answer Posted / sneha
#include <stdio.h>
int add(int a,int b)
{
if(!a)
return b;
else
return add((a&b)<<1,a^b);
}
void main()
{
int a=2, b=3, c;
c = add(a,b);
printf("%d\n",c);
}
| Is This Answer Correct ? | 15 Yes | 3 No |
Post New Answer View All Answers
Is null always equal to 0(zero)?
What is structure in c definition?
where are auto variables stored? What are the characteristics of an auto variable?
Why we use stdio h in c?
PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM
Who is the main contributor in designing the c language after dennis ritchie?
Can a local variable be volatile in c?
How can I read and write comma-delimited text?
What is an array? What the different types of arrays in c?
What is pointer to pointer in c language?
What are header files and what are its uses in C programming?
If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?
which is an algorithm for sorting in a growing Lexicographic order
I have seen function declarations that look like this
What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?