INPUT:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Methods_Function
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("\t\t\t\tCalculator");
int num1, num2;
Console.WriteLine("Enter first
number");
num1 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter second
number");
num2 = Convert.ToInt32(Console.ReadLine());
int res1 = Sum(num1, num2);
Console.WriteLine(res1);
int res2 = Subtract(num1, num2);
Console.WriteLine(res2);
int res3 = Multiple(num1, num2);
Console.WriteLine(res3);
int res4 = Divide(num1, num2);
Console.WriteLine(res4);
}
static int Sum(int Num1, int Num2)
{
int r;
r = Num1 + Num2;
return r;
}
static int Subtract(int Num1, int Num2)
{
int r;
r = Num1 - Num2;
return r;
}
static int Multiple(int Num1, int Num2)
{
int r;
r = Num1 * Num2;
return r;
}
static int Divide(int Num1, int Num2)
{
int r;
r = Num1 / Num2;
return r;
}
}
}
No comments:
Post a Comment