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

*

إرسال تعليق (0)
أحدث أقدم