You cannot create a variable like this
lern "st"+i = new lern();
in c#. It will not even compile.
You have to do something like this:
List<lern> lernList = new List<lern>();
for (i=0; i<=10; i++)
{
lernList.Add(new lern());
}
That said, we have to take a look at your outer loop.
while (ch=='n')
{
...
}
How will you get out of this loop?
Where do you change the value of
ch
?