---
title: "Write a C# program to add two numbers without using ‘+’ operator."  
description: "Write a C# program to add two numbers without using ‘+’ operator."  
author: "Steilla Mitchel"  
published: 2021-11-24  
updated: 2021-11-24  
canonical: https://www.mindstick.com/forum/156862/write-a-c-sharp-program-to-add-two-numbers-without-using-operator  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# Write a C# program to add two numbers without using ‘+’ operator.

Write a [C# program](https://www.mindstick.com/forum/156830/how-do-i-make-a-c-sharp-program-that-checks-for-given-array-by-user-which-elements-are-perfect-numbers) to [add two](https://www.mindstick.com/forum/480/add-two-number) numbers without using ‘+’ operator.

## Replies

### Reply by Ashutosh Kumar Verma

Generally ‘+’ operator is used to [add](https://www.mindstick.com/forum/12983/add-address-in-textbox-when-page-is-load-and-if-i-search-address-in-textbox-show-in-map-by-javascript) two numbers but in the following C# [program](https://www.mindstick.com/blog/12337/scaling-up-your-mentorship-program) there are add two numbers without using ‘+’ operator.

## Program:

```
using System;
public class Program
{
 public static void Main()
 {
  int a=6,b=15;
  Console.Write('Sum of '+a+' and '+b+' is : ');
  while(b!=0)
  {
   a++;
   b--;
  }
  Console.WriteLine(a);
 }
}
```

```
Output:    Sum of 6 and 15 is : 21
```

**Input number in runtime by user.**

```
Program:
using System;
public class Program
{
 public static void Main()
 {
  int a,b;
  Console.Write('Enter the first number ');
  a=int.Parse(Console.ReadLine());
  Console.Write('Enter the second number ');
  b=int.Parse(Console.ReadLine());
  Console.Write('Sum of '+a+' and '+b+' is : ');
  while(b!=0)
  {
   a++;
   b--;
  }
  Console.WriteLine(a);
 }
}
```

```
Output:
Enter the first number 14
Enter the second number 210
Sum of 14 and 210 is : 224
```

\


---

Original Source: https://www.mindstick.com/forum/156862/write-a-c-sharp-program-to-add-two-numbers-without-using-operator

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
