Answers for "substract two numbers in c#"

C#
0

substract two numbers in c#

using System;

namespace Substract{
  
	public class Program{

		public static int subtraction(int a, int b){
			return (a-b);
		}

		public static void Main(){
			int a,b;
			int difference ;

			Console.Write("Enter first number: ");
			a = Convert.ToInt32(Console.ReadLine());

			Console.Write("Enter second number: ");
			b = Convert.ToInt32(Console.ReadLine());

			difference  = subtraction(a,b);

			Console.WriteLine("Difference is: " + difference );
		}
	}
}
Posted by: Guest on August-28-2021

Code answers related to "substract two numbers in c#"

C# Answers by Framework

Browse Popular Code Answers by Language