C# Program to Add two numbers without using arithmetic Operators – Programming, Pseudocode Example, C# Programming Example
Basic C# Console

C# Program to Add two numbers without using arithmetic Operators

Write a function Add() that returns sum of two integers.  Sum of two bits can be obtained by performing XOR (^) of the two bits. Carry bit can be obtained by performing AND (&) of two bits.

This example is a fine example to understand bitwise operators.

Code:

You can find more similar examples of programming for this programming language in the site.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: