Archive

Archive for the ‘Console’ Category

Console – pozitif/negatif

06 October 2010 Leave a comment

using System;

using System.Collections.Generic;

using System.Text;

 

namespace konsol_pozitif_negatif

{


class
Program

{


static
void Main(string[] args)

{

Console.WriteLine(“girilen sayının negatif veya pozitif olduğunu bulan program”);

Console.Write(“bir sayı giriniz:”);

int x = Convert.ToInt32(Console.ReadLine());

if (x >= 0)

{

Console.WriteLine(“girilen sayı pozitiftir”);

}

else

{

Console.WriteLine(“girilen sayı negatif”);

}

Console.ReadLine();

}

}

}

Categories: Console, TÜM YAZILAR

Console – ortalama bulmak

06 October 2010 Leave a comment

using System;

using System.Text;

namespace konsol_ortalama

{

class
Program

{

static
void Main(string[] args)

{

Console.WriteLine(“-1 girilene kadar klavyeden sayı oku ve sayıların ortalamasını al”);

double toplam = 0;

double ortalama = 0;

int sayi = 0;

int s=0;

do

{

toplam = toplam + sayi;

s++;

sayi = Convert.ToInt32(Console.ReadLine());

}

while (sayi!= -1);

if (s != 1)

{

ortalama = toplam / (s-1);

}

Console.WriteLine(“ortalama=” + ortalama);

Console.ReadLine();

}

}

}

Categories: Console Tags: , ,

Console – dört işlem

06 October 2010 Leave a comment

using System;

using System.Text;

 

namespace konsol_dortislem

{


class
Program

{


static
void Main(string[] args)

{


string islem;


Console.WriteLine(“Toplama İşlemi İçin \”T\”ye basın”);


Console.WriteLine(“Çıkarma İşlemi İçin \”Ç\”ye basın”);


Console.WriteLine(“Çarpma İşlemi İçin \”X\”e basın”);


Console.WriteLine(“Bölme İşlemi İçin \”B\”ye basın”);

islem = Console.ReadLine();


if (islem == “T”)

{


Console.WriteLine(Int32.Parse(Console.ReadLine()) + Int32.Parse(Console.ReadLine()));

}


if (islem == “Ç”)

{


Console.WriteLine(Int32.Parse(Console.ReadLine()) – Int32.Parse(Console.ReadLine()));

}


if (islem == “X”)

{


Console.WriteLine(Int32.Parse(Console.ReadLine()) * Int32.Parse(Console.ReadLine()));

}


if (islem == “B”)

{


Console.WriteLine(Int32.Parse(Console.ReadLine()) / Int32.Parse(Console.ReadLine()));

}

}

 

}

}

Categories: Console, TÜM YAZILAR Tags: , ,

Console – ekrana 5 kez yazdırmak

06 October 2010 Leave a comment

using System;

using System.Text;

 

namespace konsol_5kereyaz

{

class
Program

{

static
void Main(string[] args)

{

Console.WriteLine(“x değerini girin:”);

int sayi = Convert.ToInt32(Console.ReadLine());

 

for (int index = 0; index < 5; index++)

{

Console.WriteLine(sayi);

}

Console.ReadLine();

}

}

}

Categories: Console, TÜM YAZILAR Tags: , ,

Console – 1den 100e tüm sayılar

06 October 2010 Leave a comment

using System;

using System.Text;

 

namespace konsol_1den100eTUM

{


class
Program

{


static
void Main(string[] args)

{


Console.Title = “1den 100e tüm sayılar”; // konsol ekranının başlığı


Console.BackgroundColor = ConsoleColor.Yellow; // konsol ekranının arkaplan rengi


Console.Clear(); // konsol ekranını temizle ve arkaplanı ata.


Console.WriteLine(Console.ReadLine()); // Konsol ekranına girilen karakterin aynısını yaz.


Console.ReadKey(); // Herhangi bir tuşa basılınca konsol ekranını kapat.

 


for (int s = 1; s <= 100; s++)

{


Console.WriteLine(s.ToString());

}


Console.ReadLine();

}

}

}

Follow

Get every new post delivered to your Inbox.