Program 1.
Return value of printf() -> No. of characters printed on the standard output
char a[] contains NULL string i.e. the character '\0'.
When printft() is executed , it prints nothing, ie printf() returns 0 (No. of characters printed are zero). Hence the if body isn't executed.
Program 2.
char a[] contains string of length 1, ie a 'space character'.
When printf() is executed, prints the space character onto the console, returns 1 (No. of characters printed). 'if' condition evaluates to TRUE.