c - Output Of a While Loop -


how many times while loop executed in below prog if short int of 2 bytes?

main() { int j = 1; while(j <= 255); {     printf("%d",j);      j++; } return 0; } 

i think should 255 times not correct. can tell me why?

you have semicolon @ end of while-line. while loop, consisting of statement ;, executes "infinitely" many times.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -