C# Adding 2+ numbers in a console application *beginners*
All tutorials created in C# to be posted in here.
4 posts
Page 1 of 1
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
![Image](http://i41.tinypic.com/2zodi6w.png)
How the code runs (This can be enhanced to run better)
![Image](http://i40.tinypic.com/2aje0pe.jpg)
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();
If ive helped you why not help me? http://www.points2shop.com?ref=thekingajew
Very basic, but a good start for who wants to learn C#
You can find me on Facebook or on Skype mihai_92b
Very good tutorial #thekingajew and i am glad you signed up it is me xpron3xgamer
.
![Smile :)](./images/smilies/icon_e_smile.gif)
<a href="http://www.points2shop.com/s/xbox_point ... 5082"><img src="http://points2shop.com/images/promotion ... ricoxg.gif" border="0"/></a>
Hi, Thanks for referring me to this site
Its helped me and i hope i can help others ![Smile :)](./images/smilies/icon_e_smile.gif)
![Smile :)](./images/smilies/icon_e_smile.gif)
![Smile :)](./images/smilies/icon_e_smile.gif)
pip wrote:Very good tutorial #thekingajew and i am glad you signed up it is me xpron3xgamer.
If ive helped you why not help me? http://www.points2shop.com?ref=thekingajew
4 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023