I can't understand why the following code outputs 10
.
What I understand is that !printf("0")
means !0
, which is TRUE
. So why doesn't the code print "Sachin"
#include <stdio.h>
int main() {
for (printf("1"); !printf("0"); printf("2"))
printf("Sachin");
return 0;
}
Output
10
!1 means !(true) = false so execution will stop and you will see 10 as output.