|
Using System; namespace Interfaces { interface iarifAmal { double qush
|
tarix | 18.05.2023 | ölçüsü | 22,17 Kb. | | #116442 |
| interface
using System;
namespace Interfaces
{
interface IArifAmal
{
double qush();
double ayir();
double kupaytir();
double bul();
}
class Sonlar:IArifAmal
{
public double a,b;
public void kirit()
{
Console.Write("a sonini kiriting:");
a=Convert.ToInt32(Console.ReadLine());
Console.Write("a sonini kiriting:");
b=Convert.ToInt32(Console.ReadLine());
}
public double qush()
{return a+b;}
public double kupaytir()
{return a*b;}
public double ayir()
{return a-b;}
public double bul()
{return a/b;}
public void ChopEt()
{
Console.WriteLine("{0}+{1}={2}",a,b,qush());
Console.WriteLine("{0}-{1}={2}",a,b,ayir());
Console.WriteLine("{0}*{1}={2}",a,b,kupaytir());
Console.WriteLine("{0}/{1}={2}",a,b,bul());
}
}
class Program
{
public static void Main(string[] args)
{
Sonlar c=new Sonlar();
c.kirit();
c.ChopEt();
Console.ReadKey(true);
}
}
}
Dostları ilə paylaş: |
|
|