How to use conditional ternary operator with printf in C

1 Answer

0 votes
#include <stdio.h>
  
int main() 
{ 
    int a = 13, b = 9;
    
    printf("%s\n", a > b ? "yes" : "no");
    
	printf("%s\n", a == b ? "yes" : "no");
	
    return 0; 
}



/*
run:

yes
no

*/

 



answered Sep 25, 2019 by avibootz
...