Arşiv

‘visiual studio’ Etiketi için arşiv

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace DagitimProjesi { class Program { static void Main(string[] args) { string[] askerler = {“çağlar”,”hasan”,”huseyin”,”mehmet”,”nuri”,”ulvi”,”ilkkan” }; string[] sehirler = {“ankara”,”istanbul”,”hakkari” }; string[] esleme=new string[askerler.Length]; bool[] atananAskerler=new bool[askerler.Length]; bool[] gonderilenSehirler=new bool[sehirler.Length]; Random rnd = new Random(); string secilenSehir, secilenAsker; int secilenSehirIndeksi, secilenAskerIndeksi; for (int i = 0; i [...]

131 defa okundu | Henüz yorum yok.
Ağu 12th, 2010 | Filed under C# ve Visual Studio

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace SayisalLoto { class Program { static void Main(string[] args) { Random rnd = new Random(); int[] dizi=new int[6]; int uretilen; int bulunduguIndeks; int indeks = 0; while (indeks<dizi.Length) { uretilen=rnd.Next()%49+1; bulunduguIndeks = Array.IndexOf(dizi, uretilen); if (bulunduguIndeks == -1)//üretilen değer diziye daha önce eklenmemiş { dizi[indeks] = [...]

104 defa okundu | Henüz yorum yok.
Ağu 12th, 2010 | Filed under C# ve Visual Studio

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Diziler2 { class Program { static void Main(string[] args) { Console.Write(“Kaç Kelime : “); int kelimeSayisi = Convert.ToInt32(Console.ReadLine()); string[] kelimeler=new string[kelimeSayisi]; for (int i = 0; i < kelimeSayisi; i++) { Console.Write(“{0}. kelime : “,i+1); kelimeler[i] = Console.ReadLine(); } //for (int i = 1; i <= [...]

100 defa okundu | Henüz yorum yok.
Ağu 12th, 2010 | Filed under Diziler

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace DongulerForeach1 { class Program { static void Main(string[] args) { //string bir char dizisidir string isim; Console.Write(“İsim : “); isim = Console.ReadLine(); foreach (char harf in isim) { Console.WriteLine(harf); } Console.ReadKey(); } } }

86 defa okundu | Henüz yorum yok.
Ağu 12th, 2010 | Filed under ForEach

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace DongulerDoWhile1 { class Program { static void Main(string[] args) { int sayac = 0; do { Console.WriteLine(sayac); sayac++; } while (sayac<10); Console.ReadKey(); } } }

81 defa okundu | Henüz yorum yok.
Ağu 12th, 2010 | Filed under DoWhile