How to Subtraction of Two Numbers in C#

Write a simple program to subtraction of two numbers in C#




using System;
namespace Subtraction
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = 20, b = 10, sub;
            sub = a - b;
            Console.WriteLine("{0}-{1}={2}", a, b, sub);
            Console.ReadKey();
        }
    }
}

Output:

20 - 10 = 10

*

Post a Comment (0)
Previous Post Next Post