merhaba arkadaşlar ben c# yeni başladım, yardımcı olurmusunuz, luhn kodunu hesaplama programını yapmka istiyorum textbox içerini kodları yerleştirdiğimde tek bi hata veriyor
BU HATAYI VERİYOR:
Error 1 A local variable named 'n' cannot be declared in this scope because it would give a different meaning to 'n', which is already used in a 'parent or current' scope to denote something else C:\********s and Settings\Administrator\Local Settings\Application Data\Temporary Projects\WindowsFormsApplication1\Form1.cs 49 82 WindowsFormsApplication1
Kod:
}
return (sum % 10 == 0);
}
public static bool luhnLinq(long n)
{
string s = n.ToString();
return s.Select((c, i) => (c - '0') << ((s.Length - i - 1) & 1)).Sum(n => n > 9 ? n - 9 : n) % 10 == 0;
BU HATAYI VERİYOR:
Error 1 A local variable named 'n' cannot be declared in this scope because it would give a different meaning to 'n', which is already used in a 'parent or current' scope to denote something else C:\********s and Settings\Administrator\Local Settings\Application Data\Temporary Projects\WindowsFormsApplication1\Form1.cs 49 82 WindowsFormsApplication1