Ошибка CS0103 Имя "a" не существует в текущем контексте - C#
Формулировка задачи:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _2
{
class Program
{
static void Main(string[] args)
{
for (int a = 1; a <= 20; a++) ;
Console.WriteLine(a);
Console.ReadKey();
}
}
}Решение задачи: «Ошибка CS0103 Имя "a" не существует в текущем контексте»
textual
Листинг программы
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _2
{
class Program
{
static void Main(string[] args)
{
for (int a = 1; a <= 20; a++)
; // пустой цикл
Console.WriteLine(a); // тут естественно нет никакой a
Console.ReadKey();
}
}
}