Skip to content

Instantly share code, notes, and snippets.

@nesendal
Created February 2, 2022 08:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nesendal/095be857ddf8b3a0963f201ed346a097 to your computer and use it in GitHub Desktop.
Save nesendal/095be857ddf8b3a0963f201ed346a097 to your computer and use it in GitHub Desktop.
Kullanıcıdan 5 tane karakter girmesini isteyelim,girilen her bir karakter için ayrı ayrı -> rakam ise ekrana rakamdır, harf ise harftir bilgisini yazan c# kodunu geliştiriniz.
using System;
namespace Ornek
{
class Program
{
static void Main(string[] args)
{
string deger;
Console.WriteLine("harfleri giriniz:");
deger=Console.ReadLine();
if (deger.Length == 5)
{
foreach (var item in deger)
{
if (Char.IsDigit(item))
Console.WriteLine("rakamdır");
else if (Char.IsLetter(item))
Console.WriteLine("harftir");
}
}
else
Console.WriteLine("istenilen uzunlukta değildi.");
//nagihanesendal.blogspot.com
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment