In this article I describe how to add two numbers without using the addition operator. Generally this type of question I have solved in the C language. But when I went for an interview this question was asked using the C# language. So here I have written this code.
Use the following procedure to create it.
Step 1
First of all you have to create a new Windows Store Application.
- Open Visual Studio 2012
- "File" -> "New" -> "Project..."
- Choose "Template" -> "Visual C#" -> "Window Store app"
- Choose "Blank App (XAML)" then rename the application

Step 2
Write the following XAML code in "Mainpage.Xaml" (that is available in Solution Explorer):
<Page
x:Class="Power_app.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Power_app"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="Red">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="233*"/>
<ColumnDefinition Width="142*"/>
<ColumnDefinition Width="204*"/>
<ColumnDefinition Width="787*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="78*"/>
<RowDefinition Height="49*"/>
<RowDefinition Height="43*"/>
<RowDefinition Height="40*"/>
<RowDefinition Height="38*"/>
<RowDefinition Height="520*"/>
</Grid.RowDefinitions>
<TextBlock Text="Sum of Two number without Using Addition Operator" Foreground="White" FontSize="20" FontWeight="ExtraBold" Grid.Column="2" Grid.Row="1" Grid.ColumnSpan="2"></TextBlock>
<TextBlock Text="Enter Number1" Foreground="White" FontSize="15" FontWeight="ExtraBold" Grid.Column="1" Grid.Row="2"></TextBlock>
<TextBox x:Name="textbox1" Grid.Column="2" Grid.Row="2" Width="200" HorizontalAlignment="Left" VerticalAlignment="Top" Height="32" ></TextBox>


BalaPosted Oct 12, 2015, 5:43 AM
Similarly, do u have any more operators, Example Sub, Mul, Div, Module, Percentage, so so.
BalaPosted Feb 18, 2013, 1:24 AM
Thanks Yar..
Satya PrakashPosted Feb 11, 2013, 2:54 AM
Hi, Bala this is logic In c# ~ is 1's complement operator. This is equivalent to: ~num = -num1 + 1 So, num - ~num1 -1 = num-(-num1 + 1) + 1 = num + num1 – 1 + 1 = num + num1
BalaPosted Feb 11, 2013, 1:15 AM
Hi Satya Prakash, its a wonderful article, but since im new to this windows store app, im not aware of this statement,"sum=num1-~num2-1", if you explain it will be great, thanks.