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
Why doesn't C support function overloading?
What is void main ()?
Which are low level languages?
write a proram to reverse the string using switch case?
Tell me is null always defined as 0(zero)?
What is the use of getchar functions?
What does %d do in c?
Tell us bitwise shift operators?
Difference between malloc() and calloc() function?
"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above
.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }
write a c program to print the next of a particular no without using the arithmetic operator or looping statements?
How many header files are in c?
Is there a built-in function in C that can be used for sorting data?
What is zero based addressing?