c - Confusion about the output -
#include<stdio.h> int main(void) { int i=1,j=-1; if((printf("%d",i))<(printf("%d",j))) printf("%d",i); else printf("%d",j); return 0; }
as printf()
returns number of characters printed, condition if(1<1)
false if part executed , output 1 -1 1
. why happening?
i think rather obvious: '1' 1 character, '-1' two. 1 less two.
Comments
Post a Comment