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

swift - How to change text of a button with a segmented controller? -

Rails testing error: argument of WHERE must be type boolean, not type integer -

export - Do you know some service to generate PDF online? -