This will either never loop or loop forever, depending on how your compiler defines an uninitialized variable (for signed ints it is usually the negative max).
Also, you don't ever define k, so you will also have problems with you checks/loops....plz fix the problems.
Why would it loop........ the end condition is effectively the same as the start condition. You give i a value of 1000 and say loop until i is > 1
You need:
for(int i=0;i<1000;i++)
{
//stuff goes here
}
.....and you should place your code between code tags to make it easier to read.
This will either never loop or loop forever, depending on how your compiler defines an uninitialized variable (for signed ints it is usually the negative max).
Why would it loop........ the end condition is effectively the same as the start condition.
You're both wrong. It will loop forever in every compiler.
For this for loop: