/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
using System;
class Program
{
class Topla
{ public int tpl;
public Topla(int toplam)
{ tpl = toplam; }
public int Toplama
{ get { return tpl;} // değeri görüntüleme
set { tpl= value+tpl;} // yeni değeri depola
}
}
static void Main(string[] args)
{
Topla ekle = new Topla(0);
Console.WriteLine("Başlangıç değeri->" + ekle.Toplama);
for (int i = 1; i <= 100; i++) ekle.Toplama = i;
Console.WriteLine("Sayıların toplamı" + ekle.Toplama);
Console.ReadKey();
}
}