Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace csharp_youtube_tutorial
- {
- class Program
- {
- static void Main(string[] args)
- {
- //Addition and subtraction calculator. (Simple)
- //This calculator is only limited to addition and subtraction operating<--!-->
- double num1; //We could just do float to save memory but fuck it.
- double num2;
- Console.Write("First number: ");
- num1 = Convert.ToDouble(Console.ReadLine()); /*The method ReadLine() takes the input as a string, so you have to convert it
- into a double.*/
- Console.Write("Second number: ");
- num2 = Convert.ToDouble(Console.ReadLine());
- double addition_sum = num1 + num2;
- double subtraction_sum = num1 - num2;
- Console.WriteLine("Addition: " + addition_sum);
- Console.WriteLine("Subtraction: " + subtraction_sum);
- Console.ReadKey(); //Press a key application ends. //Console[Class] ReadKey()[Function/Method]
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement