Hi
I am learning C (procedural programming now a days) and i have a very basic question, hope i will get help from this forum
suppose i have a piece of code like this
1 2 3
int i;
for(i=1; i>=1; i++)
cout<<i;
Tell me wether that loop run infinitly?
If yes then what happen when the loop reaches to the max number that int data type store that is 32767. i am talking about int range
Can any one help me to solve my confusion.
AN earliest responce in this regard is highly appreciable.
Thanks in advance to all the experts of this forum
Best Regards
That will loop while i is greater or equal to 1 but when the maximum int value is reached, adding one to that, the resulting value will be wrapped to the minimum one and the loop will stop
The minimum value for signed types should be -(max+1) so in your case -32768