Set the condition and see if it is true to tell your program with the If/else statement when the condition is true (or false) to do something specific. Check conditions with logical operators you've seen the = = operator, and you use it to check whether two variables are equal. There are a lot of other operators. You don't have to be in a hurry to remember them--you'll see them over and over again in the next few chapters. *! The = operator is similar to = =, except that it is true when the two variables you compare are not equal. * You can use < or > to compare numbers to see which size is smaller. *==,! =,<,> is called the conditional operator. When you use them to test two variables or values, this is called performing a conditional test. * You can use && representative and,| | Represents or to combine two conditional tests into one test. So check if I equals 3 or if J is less than 5, so write: (i==3) | | (j<5). Using the conditional test operator to compare two numbers is called a conditional test. Set a variable and check its value
Here is the code for the second button. This is an instruction to check whether an integer variable called x is equal to 10.