`
#include <stdio.h>
int main ()
{
int i=0;
for(printf("one\n");i<3 && printf("");i++)
{
printf("Hi!\n");
}
return 0;
}
`
**AS we already know "shortcircuiting condition of logical and operator(&&) while we solving the condition of for looping the concept used is just an logical operators According to shortcircuting concept ,for i=0 i<3 condition is true && printf("") so in this statement left part is true therefore, right side condition is not evaluated
Looking at a reference for
printf()we see:So, given
i<3 && printf(""), the first time roundiis 0, soi<3is true, thenprintf("")prints zero characters, which returns 0, which is false, so the expression becomestrue && false, thusfalse, so the loop terminates.