Created
February 2, 2022 08:35
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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