369 TESLAKALVIYOGI
Page 18 of 30

Operators Introduction

Arithmetic operators: + - * / %

</> logic
1

Concept Meaning

Arithmetic operators are symbols used for mathematical calculations.

2

Real-Life Analogy

Calculator buttons perform actions. Operators perform actions in code.

3

Expected Output

10 + 5 = 15
4

Common Mistake

Do not confuse / with fraction symbol or % with percentage in basic programming.

Same Logic • Different Syntax

Code in 4 Languages

JavaScript
let a=10,b=5;
console.log(a+b,a-b,a*b,a/b,a%b);
C++
int a=10,b=5;
cout<<a+b<<endl<<a-b<<endl<<a*b<<endl<<a/b<<endl<<a%b;
Python
a=10
b=5
print(a+b,a-b,a*b,a/b,a%b)
PHP
<?php
$a=10;$b=5;
echo $a+$b;
echo $a-$b;
echo $a*$b;
echo $a/$b;
echo $a%$b;
?>

Memory Tip

+ add, - subtract, * multiply, / divide, % remainder.