If you are a c# beginner or want to start learning the c# programming language, then this program will help you to understand the basics of c# programming.
In this tutorial, I will explain how to subtract two numbers using the c# programming language with an example and output. At the end of this program, I have shared the screenshot of program output.
Copy the below c# program and execute it in your Microsoft Visual Studio IDE (Integrated Development Environment ).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | static void Main(string[] args) { Console.WriteLine("Subtraction of two Numbers"); Console.WriteLine("***********************"); Console.WriteLine("Enter First Number"); int first = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Enter Second Number"); int second = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Addition of " + first + " - " + second + " = " + Convert.ToString(first - second)); Console.ReadLine(); } |
Liked this tutorial? Do Like & share with your friends 🙂
Ravindra Kumar is a Programmer and an independent consultant from India. He has been a part of the industry for more than 6 years. During his career, he has worked on mutiple projects of the USA and of India (Technology Evangelist at Microsoft). He received his Bachelors of Engineering from Punjan Technical University. He has been a regular speaker of SQL Sessions in Indian IT Company. View all posts by Ravindra
Tags: c# subtract numbers, c# subtract two numbers, how to subtract two numbers using c++, subtract two numbers using C#, subtraction of two numbers in asp net c#, subtraction of two numbers in c#