c - Condition Checking in a FOR loop when checking for an array element -
could please justify output of following code:
#include <stdio.h> void main() { int i,a[]={0,5}; for(i=0; i<2 && (a[i]==5) ;i++) printf("%d",i); }
according me, output should 1. on running code, don't output. please explain happening? new programming , prefer non-complex answer.
because expression a[i]==5
false when i
0
. true , false false, loop never runs.
Comments
Post a Comment