c# for ile klavyeden girilen 5 sayının toplamını bulan program.
[code lang="csharp"]
static void Main(string[] args)
{
int i,a, top = 0;
for (i = 1; i <= 5;i++)
{
Console.Write(i + ".sayıyı girin: ");
a = Convert.ToInt16(Console.ReadLine());
top = top + a;
}
Console.WriteLine ("Sayıların Toplamı:"+ top);
Console.ReadKey();
}
[/code]
Hiç yorum yok:
Yorum Gönder