Yazılım Eğitimi, Sql Server, C, C++, C#, Pyhton, Mobile, Web & IT üzerine yazılar.
7 Aralık 2017 Perşembe
C# For Else if Else örnek
Tek li sayı Çiftli sayı bölünebilen bulma
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication7
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Cift Sayilar Listeleniyor");
for (int i = 0; i <10; i++)
{
if (i == 0)
{
continue;
}
if ( i % 2 == 0)
{
Console.WriteLine(i.ToString() + "Sayisi cift bir sayi");
}
else
{
Console.WriteLine(i.ToString() + "Sayisi Tek bir sayi");
}
}
Console.WriteLine("i=1'den, Cift Sayilar ve Tek sayilar Listeleniyor..");
for (int i = 1; i < 10; i++)
{
if (i % 2 == 0)
{
Console.WriteLine(i.ToString() + "Sayisi Cift bir sayi");
}
else
{
Console.WriteLine(i.ToString() + "Sayisi Tek bir sayi");
}
}
Console.WriteLine("ilk Ucten Bolunen sayi bulunuyor..");
for (int i = 1; i < 10; i++)
{
if (i % 3 == 0)
{
Console.WriteLine(i.ToString() + "Sayisi 3' ten bolunuyor");
break;
}
}
Console.WriteLine("ilk iki 3'e tam bolunen sayilar bulunuyor");
int FoundedNumber = 0;
for (int i = 1; i < 10; i++)
{
if (i % 3 == 0 )
{
Console.WriteLine(i.ToString() + "Sayisi 3'e Tam bolunuyor.");
FoundedNumber++;
if (FoundedNumber >=2)
{
break;
}
}
}
Console.ReadLine();
}
}
}
Çıktı :
Kaydol:
Kayıt Yorumları (Atom)
Veeam Failed to retrieve object hierarchy: exception
25.02.2026 09.00 :: Host 10.0.0.10 your vcenter ip address is not available. Error: Failed to retrieve object hierarchy: exception ID 12958...
-
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="FirmaOtomasyonuWe...
-
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace App23 { class Program { stat...
-
Tek li sayı Çiftli sayı bölünebilen bulma using System; using System.Collections.Generic; using System.Linq; using System.Text; nam...
Hiç yorum yok:
Yorum Gönder