1.3 subtraction

Question


Write a program which accept two numbers and print their subtraction.

Solution


class Subtraction
    {
        static void Main(string[] args)
        {
            int a, b, c;                               //initialization
            Console.Write(“Enter first number : “);
            a = Convert.ToInt16(Console.ReadLine());
            Console.Write(“Enter second number : “);
            b = Convert.ToInt16(Console.ReadLine());
            c = a – b;                                //calculation
            Console.WriteLine(“Subtraction = “ +c);
        }
    }

 Previous                                                Home                                                  Next


Output

3