‫In Kotlin.
‫Operators are symbols or keywords that are used to perform operations on data such as arithmetic operations,
‫comparison operations, and logical operations.
‫Kotlin provides a wide range of operators to manipulate and work with different data types.
‫Arithmetic operators are used to perform mathematical calculations on numeric values in Kotlin.
‫The logical operators are used to perform logical operations on Boolean values.
‫The assignment operators are used to assign values to variables, while the relational operators are
‫used to compare values in code.
‫Now let's move to the Android Studio and start using these operators.
‫I'll start with the arithmetic operators.
‫Arithmetic operators are used to perform mathematical calculations on numeric values.
‫For that, I'll create a valuable result.
‫It's of type int equals to five plus three and I'll print the value of result.
‫Let me run the program and here we go.
‫Five plus three is eight.
‫So the first arithmetic operator is the addition the plus sign.
‫The second operator is the subtraction.
‫This operator will subtract the right operand from the left operand.
‫Run the program and the result equals to two.
‫The third operator is the multiplication, which is.
‫The asterisk.
‫In this case, multiplies two numbers run the program and the result equals to 50.
‫The fourth operator is the division.
‫I'll divide six over three.
‫It divides the left operand by the right option.
‫If both operands are integers, the result will be an integer.
‫Run and the result equals to two.
‫The new operator I'll introduce is the modulus.
‫The modulus returns the remainder of the division between two numbers.
‫For example, six divided by three equals to two, but there is no remainder.
‫If we run the program, it will give us that the result equals to zero.
‫But if I divide seven over three seven over three we have.
‫The quotient is equal to two plus the remainder equal to one.
‫So here in this case the remainder will be one.
‫So seven divided by three equals to two.
‫Two times three equals to six plus the remainder equals to one.
‫One plus six equals to seven.
‫This is the modulus operator.
‫Now let's move to the logical operators.
‫Logical operators are used to perform logical operations on Boolean values.
‫In Kotlin this includes and or not.
‫Let's start with the logical operator I'll create val result.
‫It's of type boolean.
‫You can omit this part because Kotlin will detect its type according to the value.
‫Here I'll set it to true and and true.
‫True and true equals to true here.
‫Result two I'll name it as result two.
‫And I'll cut this and paste it to here.
‫Result two.
‫And here I am checking the result two value.
‫Let me run.
‫And the result equals to true.
‫So true and true equals to true.
‫Let me check with false run true and false equals to false.
‫Let me check or operator returns a true.
‫If at least one operand is true, let me run and the result equals to true.
‫So the logical and operator returns a true.
‫If both operands are true or our operator returns true if at least one operand is true and the logical
‫not operator negates the value of the operand.
‫For example, here I can get rid of boolean.
‫I'll set not true.
‫So not true false.
‫Let me run and the result equals to false.
‫So this is the negation operator that negates the value of the operand.