C# Adding 2+ numbers in a console application *beginners*
Posted: Thu Oct 31, 2013 7:12 am
Just showing how to add 2 numbers together. Alot of you know this but when i started college i struggled to find answers to these kind of codes so i quickly put a small few line code together.
This can be easily modified and improved.
This can be a start towards making a ( - + * / ) calculator
What the code looks like
![Image]()
How the code runs (This can be enhanced to run better)
![Image]()
Get the code here, When using the code remove the comments "//"
This can be easily modified and improved.
This can be a start towards making a ( - + * / ) calculator
What the code looks like

How the code runs (This can be enhanced to run better)

Get the code here, When using the code remove the comments "//"
Code: Select all
If this is of any use please check out my website http://free4later.com/// Basic add 2 numbers together ...
// Get number 1
Console.Write("Please enter number 1 ... ");
int number1 = int.Parse(Console.ReadLine());
// Get number 2
Console.WriteLine("please enter number 2 ... ");
int number2 = int.Parse(Console.ReadLine());
// Add number 1 and number 2
int answer = number1 + number2;
// Print answer to console
Console.WriteLine("the answer is: " + answer);
// keep the console open until a key is pressed
Console.WriteLine("press a key to continue ... ");
Console.ReadKey();