c - Why output is coming infinite loop -


why question entering in infinite loop. acc me ans should 65001,65002....65535. plesae elaborate.thanks in advance

#include<> #include<stdio.h> #include<conio.h> int main() {  unsigned int i=65000;  while ( i++ != 0 )  printf("%d ",i);  return 0;  getch(); } 

on modern systems, unsigned int @ least 32 bits, expecting 16 bits. don't have infinite loop, won't wrap around until @ least 2^32 (4294967296).


Comments