369 TESLAKALVIYOGI
Page 11 of 30

Assignment Operator

How value is stored using =

</> logic
1

Concept Meaning

The assignment operator = stores a value inside a variable.

2

Real-Life Analogy

Putting a book inside a labeled box is like assigning a value to a variable.

3

Expected Output

x gets 10
4

Common Mistake

Do not confuse = with ==. One stores; the other compares.

Same Logic • Different Syntax

Code in 4 Languages

JavaScript
let x=10;
console.log(x);
C++
int x=10;
cout<<x;
Python
x=10
print(x)
PHP
<?php
$x=10;
echo $x;
?>

Memory Tip

Read x = 10 as x gets 10.