while(i<10); { i++; printf("%d,\n", i); }
Loop does not run for 10 iterations, what is the error?
If you put semicolon just after for and while loop statement; it consider there is no associated statement(s) and it does nothing it becomes a simple conditional statement nothing else.
Consider If the value of i=0, in while(i<10); it keeps on checking condition will never fails . so Loop is continuously running .
for (a=1; a<=100; a++) printf ("%d\n", a * a);
While(0) means dont enter into it, but why you want to have while(0) in c code. Any suggestion.
Asked in the interview today.