Connect 4 Techs
  • Home
  • Excel
  • Data Analysis
  • Finance
  • MBA
    • Marketing
  • Kotlin
  • Gadgets
    • Apple
    • Samsung
    • Canon
    • Tech News
  • About
  • Contact
No Result
View All Result
Connect 4 Techs
  • Home
  • Excel
  • Data Analysis
  • Finance
  • MBA
    • Marketing
  • Kotlin
  • Gadgets
    • Apple
    • Samsung
    • Canon
    • Tech News
  • About
  • Contact
No Result
View All Result
Connect 4 Techs
No Result
View All Result
Home Kotlin

Kotlin Operators (Lesson 5 PDF)

Ahmed Elhozayen by Ahmed Elhozayen
October 11, 2026
in Kotlin
0
Kotlin Operators (Lesson 5 PDF)

Kotlin is a statically typed programming language that runs on the Java Virtual Machine (JVM). It was developed by JetBrains and is now an official language for Android development. Kotlin is designed to be concise, expressive, and safe. It is also interoperable with Java, which means that you can use Kotlin and Java code together in the same project.

Kotlin

You might also like

Kotlin Class Functions & Inheritance (Lesson 13 PDF)

Kotlin Classes and Objects & Constructors (Lesson 12 PDF)

Kotlin Functions & Classes (Lesson 11 PDF)

Overview about the Lesson

This lesson is part of a series of lessons on Kotlin programming. In this lesson, we will cover the operators in Kotlin. We will start by discussing what operators are and how they work.

We will then explore the different types of operators in Kotlin, including arithmetic operators, comparison operators, and logical operators. Finally, we will look at some examples of how to use operators in Kotlin.

Kotlin Operators (Lesson 5 PDF) – page 2
Kotlin Operators (Lesson 5 PDF) – page 3
Kotlin Operators (Lesson 5 PDF) – page 4

The Content Of The Lesson

The content of this lesson is divided into the following sections:

  1. What are operators?
  2. Arithmetic operators
  3. Comparison operators
  4. Logical operators
  5. Examples

Why This Lesson

This lesson is important because operators are an essential part of any programming language. They allow us to perform various operations on data types, which is essential for building complex applications. By understanding the operators in Kotlin, you will be able to write more efficient and effective code.

Kotlin Operators: Examples and Output

This lesson’s PDF introduces arithmetic, comparison and logical operators. Run these examples to see exactly what each operator returns.

Arithmetic operators

OperatorMeaningExampleResult
+Addition7 + 310
–Subtraction7 - 34
*Multiplication7 * 321
/Division7 / 32 (Int division)
%Remainder (modulo)7 % 31
/ with DoubleDecimal division7.0 / 32.3333333333333335

The remainder operator is handy for checks such as “is this number even?”: n % 2 == 0.

Assignment and increment operators

fun main() {
    var x = 10
    x += 5    // x = 15
    x -= 3    // x = 12
    x *= 2    // x = 24
    x /= 4    // x = 6
    x %= 4    // x = 2
    x++       // x = 3
    println(x)   // 3
}

Comparison operators

OperatorMeaningExampleResult
==Equal (compares values)"kotlin" == "kotlin"true
!=Not equal5 != 3true
> / <Greater / less than5 > 3true
>= / <=Greater / less than or equal5 <= 5true
===Same object (reference equality)a === bdepends on the objects

In Kotlin, == compares content (it calls equals()), so you can compare strings safely with ==, unlike Java.

Logical operators

fun main() {
    val age = 22
    val hasTicket = true
    println(age >= 18 && hasTicket)   // true: both conditions
    println(age < 12 || age > 65)     // false: neither condition
    println(!hasTicket)               // false: negation
}

&& and || are short-circuiting: if the left side already decides the answer, the right side is not evaluated.

Operator precedence

Kotlin evaluates * / % before + -, then comparisons, then &&, then ||. So 2 + 3 * 4 is 14. Use parentheses whenever the order is not obvious.

Practice exercise

Check whether a year is a leap year: divisible by 4 and not by 100, or divisible by 400.

fun main() {
    val year = 2028
    val isLeap = (year % 4 == 0 && year % 100 != 0) || year % 400 == 0
    println("$year leap year? $isLeap")   // 2028 leap year? true
}

Frequently Asked Questions

Why does 7 / 2 return 3 in Kotlin?

Both values are Int, so Kotlin performs integer division and drops the remainder. Write 7.0 / 2 or 7 / 2.0 to get 3.5.

What is the difference between == and ===?

== checks whether two values are equal; === checks whether two references point to the very same object in memory.

Continue the course

← Previous: Lesson 4: Data Types  |  Next: Lesson 6: Set Operations & Grouping →

  1. Lesson 1: Getting Started
  2. Lesson 2: Syntax & Output
  3. Lesson 3: Comments & Variables
  4. Lesson 4: Data Types
  5. Lesson 5: Operators (you are here)
  6. Lesson 6: Set Operations & Grouping
  7. Lesson 7: Booleans & If…Else
  8. Lesson 8: When, While, Break & Continue
  9. Lesson 9: Arrays
  10. Lesson 10: For Loops & Ranges
  11. Lesson 11: Functions & Classes
  12. Lesson 12: Classes, Objects & Constructors
  13. Lesson 13: Class Functions & Inheritance

Conclusion

In conclusion, Kotlin provides a rich set of operators that can be used to perform various operations on data types. In this lesson, we covered the different types of operators in Kotlin, including arithmetic operators, comparison operators, and logical operators. We also looked at some examples of how to use operators in Kotlin. By understanding the operators in Kotlin, you will be able to write more efficient and effective code.

Download From Link

You can download the lesson from the following link:

From Here

Tags: AndroidJavaJVMKotlinProgrammingtechnology
Previous Post

Kotlin Data Type (Lesson 4 PDF)

Next Post

Kotlin Set Operations & Grouping (Lesson 6 PDF)

Ahmed Elhozayen

Ahmed Elhozayen

Ahmed Elhozayen writes and curates the guides on Connect4Techs Tech. He works in the IT field and focuses on practical, step-by-step resources for Excel, data analysis, finance, MBA studies and Kotlin programming, so readers can apply what they learn the same day.

Related Posts

Kotlin Class Functions & Inheritance (Lesson 13 PDF)
Kotlin

Kotlin Class Functions & Inheritance (Lesson 13 PDF)

by Ahmed Elhozayen
October 11, 2026
Kotlin Classes and Objects & Constructors (Lesson 12 PDF)
Kotlin

Kotlin Classes and Objects & Constructors (Lesson 12 PDF)

by Ahmed Elhozayen
October 11, 2026
Kotlin Functions & Classes (Lesson 11 PDF)
Kotlin

Kotlin Functions & Classes (Lesson 11 PDF)

by Ahmed Elhozayen
October 11, 2026
Kotlin For Loop & Kotlin Ranges (Lesson 10 PDF)
Kotlin

Kotlin For Loop & Kotlin Ranges (Lesson 10 PDF)

by Ahmed Elhozayen
October 11, 2026
 Kotlin Arrays (Lesson 9 PDF)
Kotlin

 Kotlin Arrays (Lesson 9 PDF)

by Ahmed Elhozayen
October 11, 2026
Next Post
Kotlin Set Operations & Grouping (Lesson 6 PDF)

Kotlin Set Operations & Grouping (Lesson 6 PDF)

Recommended

MS Excel Shortcuts PDF

MS Excel Shortcuts PDF

October 11, 2026
Excel Cheat Sheet for Accountants PDF

The Ultimate Guide to Master Microsoft Excel 2023 PDF

March 21, 2025

Categories

  • apple
  • Canon
  • Data Analysis
  • Excel
  • Finance
  • ios
  • Kotlin
  • Marketing
  • MBA
  • Samsung
  • Software Tutorials
  • Technology

Don't miss it

20 Essential Excel Formulas Every Data Analyst Must Know in 2026
Data Analysis

20 Essential Excel Formulas Every Data Analyst Must Know in 2026

May 18, 2026
Excel guide for data analytics learners
Excel

Excel for Data Analysis PDF

October 11, 2026
The Ultimate Guide to Financial Modeling PDF
Excel

The Ultimate Guide to Financial Modeling PDF

October 11, 2026
The Ultimate Excel Handbook PDF
Excel

The Ultimate Excel Handbook PDF

October 11, 2026
𝟓𝟎 𝐄𝐱𝐜𝐞𝐥 𝐒𝐡𝐨𝐫𝐭𝐜𝐮𝐭 𝐊𝐞𝐲
Excel

50 Excel Shortcut Key PDF: Streamline Your Workflow

March 21, 2025
Most Useful Excel Keyboard Shortcuts For Windows and Mac OS
Excel

Most Useful Excel Keyboard Shortcuts for Windows and Mac OS PDF

March 21, 2025
Connect4Techs Tech

Practical, free guides on Excel, data analysis, finance, business and programming — written to help you learn faster and work smarter.

Follow on Facebook

Topics

  • Excel
  • Kotlin
  • MBA
  • Finance
  • Data Analysis
  • Apple
  • Technology
  • Software Tutorials

Latest articles

  • 20 Essential Excel Formulas Every Data Analyst Must Know in 2026May 18, 2026
  • Excel for Data Analysis PDFAug 31, 2025
  • The Ultimate Guide to Financial Modeling PDFApr 19, 2025

Company

  • About us
  • Contact
  • Privacy Policy
  • Terms of Use
  • IT Certification PDFs
  • AI Tools & News (Connect4AI)
© 2026 Connect4Techs. All rights reserved. Privacy · Terms · Contact
No Result
View All Result
  • Home
  • Excel
  • Data Analysis
  • Finance
  • MBA
    • Marketing
  • Kotlin
  • Gadgets
    • Apple
    • Samsung
    • Canon
    • Tech News
  • About
  • Contact