369 TESLAKALVIYOGI
Page 29 of 30

Arrays Introduction

Storing multiple values in one variable

</> logic
1

Concept Meaning

An array is a special variable that can store many values in one single variable.

2

Real-Life Analogy

A marks list stores marks of many students together in one list.

3

Expected Output

[78, 82, 90, 65]
4

Common Mistake

Array index usually starts at 0, not 1.

Same Logic • Different Syntax

Code in 4 Languages

JavaScript
let fruits=["Apple","Mango","Banana"];
console.log(fruits[0]);
C++
string fruits[3]={"Apple","Mango","Banana"};
cout<<fruits[0];
Python
fruits=["Apple","Mango","Banana"]
print(fruits[0])
PHP
<?php
$fruits=["Apple","Mango","Banana"];
echo $fruits[0];
?>

Memory Tip

Array = one variable, many values in order.