¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita0
help with coding assignment
Write the output of the following cout statements, showing the steps of your work. auto value_1 = -1, value_2 = -4, value_3 = 9; if (value_1 == value_2 || value_3 / 3 > value_2) { if (value_1 - 2 * value_2 == 1) cout << "A"; else if (value_3 * -1 > 0) cout << "B"; } else { cout << "C"; }
2 Respuestas
+ 3
If a comparison is true, it returns 1
If it's false, it returns 0
5 < 3 ---> false, also called 0
5 > 3 ---> true, also called 1
When as a condition to enter a block of code you have something false (also called 0) the block is not executed.
If as a condition you have something true (also called 1) or any other number that is not 0, then the program enter the block.
If(0) { ... } The program skip it
If(-91) { ... } The program enter the block of code and executes it's instructions
+ 2
heysisters , what do you think output should be ?