About 12,500,000 results
Open links in new tab
  1. Add numbers in c# - Stack Overflow

    Dec 11, 2012 · You need to parse it as a number in order to perform integer arithmetic, e.g. string add = result.ToString(); // If you really need to... Note that you may wish to use int.TryParse in …

  2. Work with Numbers - Introductory interactive tutorial - A tour of C#

    Mar 11, 2025 · In this tutorial about numeric types, you use your browser to learn C# interactively. You're going to write C# code and see the results of compiling and running your code directly …

  3. addition - Adding Numbers in C# - Stack Overflow

    Oct 15, 2013 · 1.ToString() will return a string, which you are then adding the string "5" to, as C# will implicitly cast the number 5 to the string "5" when trying to add it to a string. You need to …

  4. C# and adding integers - Stack Overflow

    Sep 10, 2017 · int c1 = Convert.ToInt32("How many eggs did chicken 1 lay?"); int c2 = Convert.ToInt32("How many eggs did chicken 2 lay?"); int c3 = Convert.ToInt32("How many …

  5. c# - Adding numbers to a string? - Stack Overflow

    You can convert the string into a number using Convert.ToInt32 (), add 1, and use ToString () to convert it back. Parse the integer. add to your integer. make a new string variable and assign it …

  6. c# - How to add a number on the end of another number - Stack Overflow

    Mar 6, 2016 · To do this, just cast the numbers to string and concatenate them. Then you can convert the result back to a number. You can avoid string instantiation and conversion by …

  7. how to add integer in front of another integer in c#

    Jan 21, 2014 · int add = 1; int before = 7; string newNumber = string.Format("{0}{1}", add, before); If you want to convert the int afterwards into an int again, you could use int.Parse () or …

  8. c# - How do you add numbers to an int? - Stack Overflow

    Jan 22, 2015 · You can do it with something like (where s is a string): s = (Int32.Parse(s) + 1).ToString(); Just make sure that s is actually a valid number, otherwise you'll have to cobble …

  9. C# How To Add Two Numbers - W3Schools

    Example Get your own C# Server int x = 5; int y = 6; int sum = x + y; Console.WriteLine(sum); // Print the sum of x + y Try it Yourself »

  10. Concatenating integers to string in C# - Techie Delight

    May 13, 2022 · This article illustrates the different techniques to concatenate integers to a string in C#... A simple solution to concatenate an integer to a string is using the + operator.

  11. Some results have been removed
Refresh