toplama_donguler_ile_03_10_2015

Transkript

toplama_donguler_ile_03_10_2015
Solution : toplama_donguler_ile
Proje : toplama_for_dongusu_ile
using
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Linq;
System.Text;
System.Threading.Tasks;
System.Windows.Forms;
namespace toplama_for_dongusu_ile
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private
{
int
int
int
void button1_Click(object sender, EventArgs e)
x = Convert.ToInt32(textBox1.Text);
y = Convert.ToInt32(textBox2.Text);
i, top = 0;
for (i = x; i <= y; i++)
{
top = top + i;
}
label5.Text = top.ToString();
}
}
}
Nahit Menteşe Mesleki ve Teknik Anadolu Lisesi - Nesne Tabanlı Programlama Dersi – D.GABRALI , N.ÜNSAL
Sayfa 1
Proje : toplama_while_dongusu_ile
using
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Linq;
System.Text;
System.Threading.Tasks;
System.Windows.Forms;
namespace toplama_while_dongusu_ile
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private
{
int
int
int
void button1_Click(object sender, EventArgs e)
x = Convert.ToInt32(textBox1.Text);
y = Convert.ToInt32(textBox2.Text);
i, top = 0;
i = x;
while (i <= y)
{
top = top + i;
i++;
}
label5.Text = top.ToString();
}
}
}
Nahit Menteşe Mesleki ve Teknik Anadolu Lisesi - Nesne Tabanlı Programlama Dersi – D.GABRALI , N.ÜNSAL
Sayfa 2
Proje : toplama_do_while_dongusu_ile
using
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Linq;
System.Text;
System.Threading.Tasks;
System.Windows.Forms;
namespace toplama_do_while_dongusu_ile
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private
{
int
int
int
void button1_Click(object sender, EventArgs e)
x = Convert.ToInt32(textBox1.Text);
y = Convert.ToInt32(textBox2.Text);
i, top = 0;
i = x;
do
{
top = top + i;
i++;
} while (i <= y);
label5.Text = top.ToString();
}
}
}
Nahit Menteşe Mesleki ve Teknik Anadolu Lisesi - Nesne Tabanlı Programlama Dersi – D.GABRALI , N.ÜNSAL
Sayfa 3

Benzer belgeler

Program Çalışması

Program Çalışması C#’da Visual basic6.0 daki gibi bir bilgi giriş fonksiyonu yoktur. Fakat bu fonsiyonu Visual

Detaylı

Geometrik ortalama

Geometrik ortalama Soru 2. 10 elemanı ve değerleri dışarıdan girilen bir dizinin aritmetik ortalamasını, geometrik ortalamasını, maksimum ve mininumun değerlerini ve standart sapmasını hesaplayan bir program yazınız.

Detaylı

Untitled

Untitled Solution : toplama_donguler_ile Proje : toplama_for_dongusu_ile

Detaylı