Jump to content

C# Diziler Hakkında Sorum Var


MasterTR

Recommended Posts

[b]Button1 tıklandığında 150 ile 250 arasında üretilen rastgele 10 sayıyı console ekranına yazan programı yazınız. [/b]
Şu Code yardımcı olabilirmisiniz?
[code] Random rnd = new Random();
int[] RasgeleDizi = new int[100];
for (i = 0; i < 11; i++)
RasgeleDizi[i] = rnd.Next(150,250);
Console.WriteLine((RasgeleDizi[i]));
Console.ReadLine();
[/code]
[u]hata alıyorum hatam nerde acaba?[/u]
Link to comment
Share on other sites

[codebox]
int buyuk = 150;
int kucuk = 250;
for (i = 0; i < 100; i++)
{
if(RasgeleDizi[i] > buyuk) {
buyuk = RasgeleDizi[i];
}
if(RasgeleDizi[i] < kucuk) {
kucuk = RasgeleDizi[i];
}
}
[/codebox]
Bu mantıkla olabilirmi ?

Edit : Pardon 150 yazmayı unutmuşum :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...