using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace all_operation_accept_2_number
{
class Program
{
public void addition(int n1,int n2)
{
int sum = n1 + n2;
Console.WriteLine("Sum :" + sum);
}
public void subtraction(int n1, int n2)
{
int sub = n1 - n2;
Console.WriteLine("Subtraction:" + sub);
}
public void multiplication(int n1, int n2)
{
int mul = n1 * n2;
Console.WriteLine("Multiplication:" + mul);
}
public void division(int n1, int n2)
{
if (n2 == 0)
{
Console.WriteLine("Can't devided by zero");
}
else
{
int div = n1 / n2;
Console.WriteLine("Devision:" + div);
}
}
static void Main(string[] args)
{
Console.WriteLine("Enter two number:");
int n1 = Convert.ToInt32(Console.ReadLine());
int n2 = Convert.ToInt32(Console.ReadLine());
Program obj = new Program();
Console.WriteLine("Results:-\n");
obj.addition(n1,n2);
obj.subtraction(n1, n2);
obj.multiplication(n1, n2);
obj.division(n1, n2);
Console.ReadLine();
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace all_operation_accept_2_number
{
class Program
{
public void addition(int n1,int n2)
{
int sum = n1 + n2;
Console.WriteLine("Sum :" + sum);
}
public void subtraction(int n1, int n2)
{
int sub = n1 - n2;
Console.WriteLine("Subtraction:" + sub);
}
public void multiplication(int n1, int n2)
{
int mul = n1 * n2;
Console.WriteLine("Multiplication:" + mul);
}
public void division(int n1, int n2)
{
if (n2 == 0)
{
Console.WriteLine("Can't devided by zero");
}
else
{
int div = n1 / n2;
Console.WriteLine("Devision:" + div);
}
}
static void Main(string[] args)
{
Console.WriteLine("Enter two number:");
int n1 = Convert.ToInt32(Console.ReadLine());
int n2 = Convert.ToInt32(Console.ReadLine());
Program obj = new Program();
Console.WriteLine("Results:-\n");
obj.addition(n1,n2);
obj.subtraction(n1, n2);
obj.multiplication(n1, n2);
obj.division(n1, n2);
Console.ReadLine();
}
}
}