using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication3
{
public partial class Form1 : Form
{
Random r = new Random();
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int sayi, i;
int countonbes = 0;
int countondort = 0;
listBox1.Items.Clear();
for (i = 0; i < 100; i++)
{
sayi = r.Next(14, 16);
listBox1.Items.Add(sayi);
if (sayi.ToString() == "15")
countonbes = countonbes + 1;
else if (sayi.ToString() == "14")
countondort = countondort + 1;
label1.Text = countonbes.ToString() + " tane 15 var"; //kaç tane onbeş olduğunu label1 e yazdır.
label2.Text = countondort.ToString() + " tane 14 var"; //kaç tane ondört olduğunu label2 ye yazdır
}
}
}
}