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
Can a pointer point to null?
What is LINKED LIST? How can you access the last element in a linked list?
How can I automatically locate a programs configuration files in the same directory as the executable?
explain what are pointers?
How is a structure member accessed?
what is uses of .net
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
State the difference between realloc and free.
Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon
Why string is used in c?
What are the types of macro formats?
Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?
Write a program to implement queue.
what are enumerations in C
What are global variables?