Search This Blog

Saturday, 12 September 2015

Add two number without using + operator in C#

int x = 10;
int y = 20;
int add = x - ~y - 1;
Console.WriteLine("The answer is:{0}",  add);

Console.ReadKey();

Output:

The answer is: 30

No comments:

Post a Comment