for (i = 0; i < 14; i++)
{
//display data here
}
Console.WriteLine("{0}", i);
Console.ReadLine();
I want to display the amount of times total i iterated outside the for statement so it only displays ONCE.
for (i = 0; i < 14; i++)
{
//display data here
}
Console.WriteLine("{0}", i);
Console.ReadLine();
I want to display the amount of times total i iterated outside the for statement so it only displays ONCE.
You can do:
int i = 0;
for(;i < 50; i++)
{
// Do some stuff
}
Console.WriteLine(i.ToString());
Hope this helps!
Just add an i
declaration before your for loop:
int i;
for (i = 0; i < 14; i++)
{
//display data here
}
Console.WriteLine("{0}", i);
Console.ReadLine();