What's the “condition” in C interview test?

后端 未结 30 2910
旧时难觅i
旧时难觅i 2020-12-05 02:37

Would it be possible to print Hello twice using single condition?

if  \"condition\"
  printf (\"Hello\");
else
  printf(\"World\");         


        
30条回答
  •  长情又很酷
    2020-12-05 03:11

    if ( printf("Hello")==0)
    

    see [http://www.coders2020.com/what-does-printf-return]

    (matt corrected my =, thanks, C is far away)

提交回复
热议问题