True/False instead of YES/NO in output

Правка en1, от pribic, 2021-01-26 09:46:19

A lot of time we have seen problems where we need to output a YES or No. Usual way of doing this is flag ? "YES" : "NO" however many programming language supports directly printing boolean as True or False.

So is there any specific reason we are asked to print YES/NO instead TRUE/FALSE?

Here is a simple diff between both approach:

System.out.println(flag? "YES" : "NO" );

vs

System.out.println(flag);

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский pribic 2021-01-26 09:46:19 465 Initial revision (published)