fork(3) download
  1. #include <stdio.h>
  2.  
  3. #define ternary(cond, true, false) ( (void *[]){true,false}[!cond] )
  4.  
  5. int main(void) {
  6. int x;
  7. scanf("%d",&x);
  8.  
  9. printf(ternary(x,"non-zero","zero"));
  10.  
  11. printf("\n%d\n",ternary(x,1,0));
  12.  
  13. return 0;
  14. }
Success #stdin #stdout 0s 4476KB
stdin
42
stdout
non-zero
1