That's some weird code...
cnt = 0 (cnt equals zero)
cnt = cnt + 1 (so now cnt equals 1)
cnt = cnt + 1 (so now cnt equals 2)
starting variable "counter" at 0,
and incrementing "counter" by 1,
while the variable 'counter' equals 100
{
increment the variable "cnt" by 1 (and since cnt is already
2...)
}
write the value of the variable "cnt, which will always be 102!
"Delphi Sleuth" <hd****@star-telegram.com> wrote in message
news:23**************************@posting.google.c om...
what the heck am I not getting. This little snipet doesn't do what I
thought it was going to do. Can anyone tell me why? I expected
2
Hello: 102
All I get is the 2. I had been trying to iterate though a list that
was not working... please help!
int cnt = 0;
cnt = cnt + 1;
cnt = cnt + 1;
Response.Write(cnt.ToString());
for (int counter = 0; counter == 100; counter++)
{
cnt++;
}
Response.Write("<BR>Hello: " + cnt.ToString());