Page 138 - CITS - CSA - TP (Volume 1) - Hindi
P. 138
कंप्यूटर सॉफ्टवेयर एप्लीकेशन- CITS
अ ास 38 : वै रएबल, ऑपरेटरों का उपयोग करना और ए ेशन िलखना (Using Variables,
Operators and Writing Expressions)
उ े
इस अ ास के अंत म आप यह कर सक गे
• वे रएबल बनाएं
• ऑपरेटरों का उपयोग कर
• यु ऑपरेटर
आव कताएं (Requirements)
औजार/साम ी (Tools/Materials)
• लेटे कॉ फ़गरेशन वाला डे टॉप / लैपटॉप
• टे एिडटर
• वेब ाउज़र
ि या (Procedure)
टा 1: वै रएबल का उपयोग करना
I वै रएबल घोिषत करना और वै ू िनिद करना
1 टे एिडटर ओपन कर
2 िन िल खत कोड िलख
<html >
<head>
<title> Declaring variables and assigning values </title>
</head>
<body>
<script>
// Declaring variables
let x; // Declaration without initialization
let y = 5; // Declaration with initialization
// Assigning values to variables
x = 10;
// Printing variables
console.log(“Value of x:”, x); // Output: 10
console.log(“Value of y:”, y); // Output: 5
// Reassigning variables
x = 20;
y = 8;
console.log(“Updated value of x:”, x); // Output: 20
122

