Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Write a program to perform addition of two numbers without using +
#1

Hint: We can do using the bit wise operators.


Try it....
Reply
#2

Code:
//
// ravi's program :P njoy buddy
//
#include <stdio.h>
#define RADD(a, b) printf(" result = %d\n", (a | b)+(a & b))

int main()
{
int a, b;
a = 10; b = -44;
RADD(a, b);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)