C#’ ta sınıflarla ilgili örnek için tıklayınız.fark.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication73
{
class fark
{
public int bul(int aa, int bb, int cc)
{
int max=0, min=100;
if (aa > max)
max = aa;
if (bb > max)
max = bb;
if (cc > max)
max = cc;
if (aa <min)
min = aa;
if (bb < min)
min = bb;
if (cc < min)
min = cc;
return max – min;
}
}
}
program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication73
{
class Program
{
static void Main(string[] args)
{
int a, b, c;
a = Convert.ToInt32(Console.ReadLine());
b = Convert.ToInt32(Console.ReadLine());
c = Convert.ToInt32(Console.ReadLine());
fark xx = new fark();
Console.WriteLine(xx.bul(a,b,c));
Console.ReadLine();
}
}
}