Computer Science, asked by neerajsingh12345, 5 months ago

rewrite the given code of ternary operator if (a>100)
system.out.println("greater")
else
system.out.println("smaller")​

Answers

Answered by Anonymous
1

Answer:

Chapter 5  Conditionals and logic

The programs we’ve seen in previous chapters do pretty much the same thing every time, regardless of the input. For more complex computations, programs usually react to the inputs, check for certain conditions, and generate appropriate results. This chapter presents the features you need for programs to make decisions: a new data type called boolean, operators for expressing logic, and if statements.

5.1  Relational operators

Relational operators are used to check conditions like whether two values are equal, or whether one is greater than the other. The following expressions show how they are used:

Similar questions