L
LLLOS.ai
Learn
L

Chapter 1 — Revision of Class IX Syllabus

Class 10 · Computer Applications

Overview

This unit revises the complete Class IX Computer Applications syllabus for Class X students. It revisits computer fundamentals, hardware components, software types, operating systems, basic programming concepts using Python, algorithms, flowcharts, data types, control structures, functions, arrays and lists, file handling, simple database concepts, HTML basics, networking and the internet, and cyber safety. The revision reinforces conceptual clarity, strengthens problem-solving skills, and prepares students for board-style questions and practical tasks. Emphasis is placed on understanding why each topic matters: hardware and software form the backbone of computing, programming builds logical thinking and automation skills, databases help store organised information, and networking connects systems globally. Practical examples, worked problems, and diagrams help consolidate learning. By revising these topics, students gain confidence in writing programs, designing algorithms, handling files, creating simple web pages, and following safe online practices. This consolidated review helps bridge Class IX learning to the expectations of Class X exams and practical assessments, ensuring students can apply concepts in both theory papers and laboratory exercises.

Learning Objectives

  • Recall and explain fundamental computer components and their functions.
  • Differentiate between types of software and operating systems and describe their roles.
  • Design algorithms and flowcharts for simple problems and translate them into Python code.
  • Use Python data types, variables, and operators correctly in programs.
  • Apply control structures—sequence, selection, and iteration—to solve programming tasks.
  • Create and use functions, lists (arrays), and simple file operations in Python.
  • Understand basic database concepts and perform simple SQL queries conceptually.
  • Describe internet services, basic HTML structure, and safe digital practices.

Topics in this chapter

18 topics · tap a topic title to jump straight to it.

🐒1

Computer Fundamentals and Evolution

What is a computer?
A computer is an electronic device that accepts input, processes it according to instructions, produces output and stores results if needed. This cycle—input, process, output and storage—forms the basis of all computing tasks. Computers carry out arithmetic and logical operations automatically and follow exact sequences of instructions given by software.

Core ideas to remember
A computer system has hardware (tangible parts) and software (intangible instructions). Hardware like CPU, memory and storage perform the actual work while software directs hardware. Understanding this separation helps to see why a machine can run different programs: the hardware stays same but software changes functionality.

Evolution and generations
Over time computers evolved through distinct generations. Early machines used vacuum tubes and were large and power-hungry. The transistor age made devices smaller and more reliable. Integrated circuits allowed multiple transistors on a chip, reducing size further. The microprocessor placed the entire CPU on a single chip, enabling personal computers. Modern systems use very large scale integration, multicores and energy-efficient designs. Each step reduced cost and size while increasing speed and capability.

Characteristics of a computer
Important characteristics include speed (how fast operations are carried out), accuracy (few human errors in calculations), storage capacity (ability to hold large amounts of data), automation (ability to execute sequences without human intervention), and versatility (able to perform many kinds of tasks). These features explain why computers are used for tasks ranging from simple calculations to complex simulations.

Information and data
Data are raw facts; information is processed data that is meaningful. Computers transform data into information using algorithms. For example, a list of marks is data; computing the class average turns it into information useful for decisions.

Why this matters for learners
Knowing fundamentals helps students understand how higher-level topics like programming, networking and databases work. A clear grasp of the basic cycle and evolution helps in troubleshooting, choosing hardware, and appreciating how software controls the machine. It forms a solid foundation for practical work and more advanced studies.

📌 Examples
  • Explaining how typing on a keyboard (input) leads to text appearing on the screen (output) and being saved in a file (storage).
  • Comparing an old vacuum-tube computer to a modern laptop to show improvements in size and speed.
  • Describing how a calculator performs arithmetic operations similar to a computer's ALU.
🧮 Formulas
  1. Input → Process → Output → Storage (information cycle)
  2. CPU = ALU (Arithmetic and Logic Unit) + CU (Control Unit)
📊 Visual ideas
Draw a block diagram showing Input devices → CPU (with ALU and CU) → Memory → Output devices → Secondary storage.
Timeline chart of computer generations with brief labels for technology used in each generation.
⚙️2

Hardware: Components and Working

Overview of hardware
Hardware refers to all physical parts of a computer that you can touch. Learning about hardware means recognising components inside a computer case, outside it, and understanding how they work together. Hardware components are organised to accept input, process it, and present output, with storage used to keep data between sessions.

Motherboard, CPU and chipsets
The motherboard is the main printed circuit board that connects every component. It contains slots for RAM, sockets for the CPU, connectors for storage and ports for peripherals. The CPU (central processing unit) executes instructions; it consists of the control unit (CU) and arithmetic logic unit (ALU). The chipset on the motherboard aids communication between CPU, memory and peripherals. Modern CPUs have multiple cores allowing parallel task execution.

Memory types: RAM and ROM
Primary memory includes RAM (Random Access Memory) and ROM (Read Only Memory). RAM is volatile; it holds data and programs currently in use and loses content when power is off. RAM size and speed directly affect how many programs can run smoothly. ROM stores firmware—permanent instructions such as BIOS/UEFI—that help initialise hardware at boot and rarely changes.

Secondary storage devices
Secondary storage keeps data permanently. Hard Disk Drives (HDD) use magnetic platters and moving heads; they offer large capacity at lower cost but are slower. Solid State Drives (SSD) use flash memory chips, have no moving parts, and provide much faster read/write speeds and better durability. External storage includes USB flash drives and external HDD/SSD. Optical drives (CD/DVD) are less common but still used for some purposes.

Input and output devices
Input devices convert user actions into data: keyboard, mouse, scanner, microphone, camera. Output devices present results: monitor shows visual output, printer gives physical copies, speakers provide audio. Some devices are both input and output, such as touchscreens and network cards.

Ports, expansion and cooling
Ports (USB, HDMI, Ethernet, audio jacks) connect peripherals. Expansion slots (PCIe) allow adding components like graphics cards or network cards. Cooling is essential: fans, heat sinks and sometimes liquid cooling remove heat from CPU/GPU to prevent damage and throttling. Proper ventilation and dust management improve lifespan and reliability.

Troubleshooting and maintenance
Basic checks for hardware problems include ensuring power supply, correct cable connections, listening for beep codes during startup, and checking LEDs. Regular maintenance—dusting components, updating firmware/drivers, monitoring temperatures, and backing up data—keeps systems running. Understanding hardware helps students choose suitable devices and diagnose common faults.

📌 Examples
  • Describing how RAM size affects how many programs can run simultaneously without slowing the computer.
  • Explaining why an SSD boots faster than an HDD due to no moving parts and faster access times.
🧮 Formulas
  1. Storage capacity example: Total size = number of blocks × block size (conceptual)
  2. CPU performance factors = Clock speed × Instructions per cycle × Number of cores (conceptual)
📊 Visual ideas
Labelled diagram of a desktop computer's internal layout showing motherboard, CPU, RAM, power supply, HDD/SSD.
Sketch comparing access time differences between RAM, SSD, and HDD on a vertical bar chart.
⚔️3

Software: System and Application

Understanding software
Software is a collection of instructions and data that tell hardware what to do. While hardware performs the actions, software decides which actions to perform. Software cannot be touched like hardware but is essential for hardware to be useful. It ranges from basic system programs that manage the machine to application programs that help users accomplish specific tasks.

System software components
The most important system software is the operating system (OS). The OS manages resources such as CPU scheduling, memory allocation, file systems and device drivers. It provides a platform for running application software and offers user interfaces—graphical or command line. Other system software includes utility programs (antivirus, disk defragmenters, backup tools) and firmware which contains low-level control for hardware.

Application software
Application software helps users perform tasks: word processors for writing, spreadsheets for calculations, browsers for surfing the web, media players for audio/video playback, and educational software for learning. Application software runs on top of the OS and uses system calls and APIs to access hardware features safely and efficiently.

Types and distribution
Software can be proprietary (licensed, paid), free, open-source (source code available for modification), or shareware (trial-based). Understanding licenses is important: using software legally avoids infringement and security risks. Open-source projects allow learning from real code, but proper credit and license compliance are necessary.

Software development process
Creating software follows stages: requirements analysis (what the program must do), design (how it will work), implementation (coding), testing (finding and fixing bugs), deployment (making it available), and maintenance (updates and bug fixes). Documentation is essential at each stage so that others can understand, maintain, or improve the software.

Interaction with hardware
Device drivers are special software that translate OS commands into signals that hardware understands. Without drivers, peripherals cannot function correctly. System updates often include driver improvements and security patches; keeping software up to date is vital to avoid vulnerabilities and ensure compatibility.

Why software knowledge matters
For students, understanding software helps in choosing the right applications, installing and configuring programs responsibly, and appreciating the steps needed to build reliable programs. It also clarifies why different software behaves differently on the same hardware and how software choices affect performance and security.

📌 Examples
  • Explaining how a web browser (application) uses the OS to open network sockets and display web pages.
  • Describing how an antivirus utility scans files and quarantines detected threats.
🧮 Formulas
  1. No numeric formulas; definitions: System software = OS + utilities + device drivers
📊 Visual ideas
Layered diagram showing Hardware at bottom, System software (OS) in middle, and Application software at top.
Flowchart of the software development life cycle: Requirements → Design → Implementation → Testing → Deployment → Maintenance.
💻4

Operating Systems: Functions and Types

What is an Operating System?
An Operating System (OS) is system software that manages hardware resources and provides services to applications and users. It acts as an intermediary between user-level programs and physical hardware. Without an OS, running and coordinating multiple programs would be much harder and less secure.

Main functions of an OS
Process management: The OS creates, schedules and terminates processes. It ensures fair CPU time using scheduling algorithms so multiple programs appear to run simultaneously. Memory management: The OS allocates RAM to processes, keeps track of free and used memory, and uses techniques like paging to manage space efficiently. File system management: The OS organises files in directories, handles file permissions and maintains data integrity. Device management: It interacts with hardware through drivers and abstracts device-specific details. Security and user management: The OS provides user accounts, authentication, and access control to protect data and resources. It also manages input/output buffering and error handling.

Types of operating systems
Single-user single-tasking systems run one task at a time (simple embedded devices). Single-user multi-tasking systems (most desktop OS) allow a single user to run multiple applications simultaneously. Multi-user systems let multiple users use the system resources concurrently, common in servers. Real-time operating systems (RTOS) are used in critical systems where timely response is essential, like medical devices and industrial controllers. Distributed operating systems manage a group of networked computers as a single system, and mobile operating systems like Android and iOS are optimised for touch interfaces and power efficiency.

File systems and storage management
Filesystems such as FAT, NTFS and ext4 determine how data is stored and retrieved on disks. They maintain metadata including file size, timestamps and permissions. The OS handles reading/writing operations and ensures consistency during crashes using journaling or transactional methods.

Boot process
The boot process starts when a computer powers on. Firmware (BIOS/UEFI) performs POST (Power On Self Test), initialises hardware, and loads the bootloader. The bootloader then loads the OS kernel into memory. Understanding this helps diagnose startup failures and configure boot options.

User interfaces and utilities
Many OSs provide graphical user interfaces (GUI) for ease of use, while command-line interfaces (CLI) offer powerful control for advanced users. Utility programs such as disk cleanup, backup, and antivirus help maintain the system. Regular updates and patches are essential to address security vulnerabilities and improve functionality.

📌 Examples
  • Describing how an OS schedules two programs so both appear to run simultaneously using CPU time-slicing.
  • Explaining file permissions: read, write, and execute for different user classes.
🧮 Formulas
  1. No numeric formulas; key term: Multitasking = sharing CPU among processes using scheduling algorithms
📊 Visual ideas
Diagram of boot sequence: Power on → BIOS/UEFI → POST → Bootloader → Kernel → User space
Illustration of layered OS services: Hardware → Kernel → Device drivers → System calls → User applications.
💻5

Algorithms and Flowcharts

Defining an algorithm
An algorithm is a step-by-step method to solve a problem. It must be finite, clear, unambiguous and effective. An algorithm can be expressed in different forms: natural language, pseudocode, or using diagrams such as flowcharts. For programming, clear algorithms help translate logic into code without confusion.

Steps in designing an algorithm
First, read and understand the problem carefully and identify inputs and outputs. Next, break the problem into smaller tasks or modules. Choose data structures needed (like lists or variables) and decide on control structures (loops, conditions). Write the steps in order and test the algorithm with sample inputs, including edge cases. Finally, refine to handle errors and improve clarity.

Flowcharts as visual tools
A flowchart graphically represents an algorithm using standard symbols. A Start/End oval marks the beginning and end. A parallelogram denotes Input/Output, a rectangle denotes a Process (assignment or operation), and a diamond shows a Decision (yes/no). Arrows indicate the flow of control. Flowcharts help visualise the program flow, find logical errors early, and communicate solutions to others clearly.

Common algorithmic constructs
Sequence: Execution of statements one after another. Selection: Making choices using if/else or nested conditions. Iteration: Repeating actions using loops (for, while). Modularisation: Dividing problems into functions or subroutines for reuse and clarity. Many programming tasks combine these constructs; for example, reading a list of numbers (sequence), checking each number (iteration), and deciding whether to include it in a result (selection).

Testing and correctness
Always test algorithms using representative data, small cases and boundary values. Dry run the steps manually to check correctness. For algorithms that use loops, ensure termination by having proper update steps for loop variables and clear base or exit conditions.

Efficiency awareness
For Class X, focus on correctness and clarity; however, understanding that some algorithms are faster or use less memory than others is useful. Simple awareness—like avoiding unnecessary nested loops for large data—helps design better solutions.

Practical benefits
Learning to write algorithms and draw flowcharts improves logical thinking and problem decomposition. These skills are directly transferable to writing programs, debugging them, and explaining solutions in exams or practical tests.

📌 Examples
  • Algorithm to find the largest of three numbers written in steps and then drawn as a flowchart.
  • Flowchart to compute the sum of first N natural numbers using a loop and accumulator variable.
🧮 Formulas
  1. No numeric formulas; rules: Algorithm must be finite, definite, and effective.
📊 Visual ideas
Flowchart showing Start → Input N → Initialize sum=0, i=1 → Decision i<=N? → Process sum=sum+i; i=i+1 → Loop back → Output sum → End
Flowchart for largest of three: Start → Input a,b,c → Compare a>b? → nested decisions → Output largest → End
🧾6

Introduction to Python: Basics and Syntax

Why choose Python for beginners?
Python is simple, readable and widely used. Its syntax uses indentation to mark blocks which encourages neat programming habits. Being an interpreted language, Python shows errors immediately which helps learners find and fix mistakes quickly. It supports many programming styles such as procedural and object-oriented programming.

Basic structure of a Python program
A Python program consists of statements executed in sequence. Comments are written using # for single-line notes and triple quotes for multi-line documentation strings. Indentation (spaces) groups statements into blocks—this replaces braces used in other languages. A typical small program reads input, processes it and prints output using print().

Variables and naming rules
Variables are names that refer to values. There is no need to declare variable types explicitly; Python determines types at runtime. Variable names must begin with a letter or underscore and may contain letters, digits and underscores; they are case-sensitive. Use meaningful names to make code readable: total_score is clearer than t1.

Input and output
Use input() to read user input as a string; convert to needed type with int(), float() or str(). Example: age = int(input('Enter age: ')). Use print() to display messages and results; it can accept multiple values separated by commas and support formatted output.

Basic data types
Common types include int for integers, float for decimals, str for text, and bool for True/False. Python also provides compound types like list, tuple and dict. Understanding types helps avoid errors during operations—adding numbers and concatenating strings behave differently.

Expressions and simple statements
Expressions combine variables and operators to compute values. Assignment uses =, and multiple assignment is allowed: a, b = 5, 10. Use arithmetic operators (+, -, *, /, //, %, **) for calculations. For string operations, + concatenates and * repeats strings.

Error handling and debugging
Syntax errors occur when code is incorrectly formed; runtime errors appear during execution. Use print statements to trace variable values and understand program flow. IDEs and online interpreters show error messages and line numbers to help debug. Practise small programs and test often to gain confidence.

📌 Examples
  • Simple program: Read two numbers, add them, and print the result using int(input()) and print().
  • Showing string concatenation: first = 'Ram'; last = 'Kumar'; print(first + ' ' + last).
🧮 Formulas
  1. No mathematical formulas; syntax rules: Indentation defines blocks; statements end with newline.
  2. Type conversion examples: int('10') = 10, float('3.14') = 3.14, str(5) = '5'
📊 Visual ideas
Diagram showing program flow: Start → Read input → Process (compute) → Output → End
Indentation example: show nested blocks with increasing indentation levels.
📊7

Data Types, Variables and Operators in Python

Understanding data types
Data types tell the computer how to interpret stored values. In Python common primitive types are int (integers), float (decimal numbers), str (text), and bool (True/False). Compound types include list, tuple and dict. Knowing types helps choose correct operations and avoid type errors—for example, adding two numbers differs from concatenating strings.

Variables and assignment
Variables are names that refer to values stored in memory. Assign a value using =. Python supports multiple assignment: a, b = 5, 10 assigns values to both variables in one line. Variables are dynamically typed; a variable can first hold an integer and later a string, but clear naming and consistent use are recommended for readability and fewer bugs.

Operators
Arithmetic operators perform numerical calculations: + (addition), - (subtraction), * (multiplication), / (division producing float), // (integer division), % (modulus gives remainder), ** (exponentiation). Comparison operators compare values: ==, !=, >, <, >=, <= and return Boolean results. Logical operators combine conditions: and, or, not. Assignment operators such as += and -= combine arithmetic and assignment in one step.

Operator precedence and parentheses
Python evaluates expressions according to precedence: parentheses first, then exponentiation, then multiplication/division/modulus, then addition/subtraction, and finally comparison and logical operators. Use parentheses to make expressions clear and control evaluation order when needed.

Type conversion (casting)
Convert values between types using int(), float(), str(), and bool(). For example, int('12') converts a numeric string to integer. Converting invalid strings raises errors; ensure strings represent valid numbers before conversion. Implicit conversions occur in some expressions (for example, int and float combined yields float result).

Strings and sequences
Strings are sequences of characters and support indexing and slicing. Indexing starts at 0: s[0] is the first character. Slicing s[i:j] returns substring from i to j-1. Strings are immutable; operations produce new strings. Lists are mutable ordered collections that can hold heterogeneous elements, support indexing, slicing, and methods like append() and remove().

Practical advice
Use descriptive variable names, check types when errors occur, and test small expressions interactively. Knowing operators and types well helps write correct conditions and calculations in programs.

📌 Examples
  • Demonstrate modulus: 17 % 5 = 2 and integer division: 17 // 5 = 3.
  • Show list usage: nums = [1,2,3]; nums.append(4); print(nums) outputs [1,2,3,4].
🧮 Formulas
  1. Operator precedence: Parentheses > Exponentiation > Multiplication/Division/Modulus > Addition/Subtraction
  2. Type conversions: int('12') => 12; float(3) => 3.0; str(5) => '5'
📊 Visual ideas
Table-like sketch showing operator categories with examples and priorities.
Diagram showing string indexing positions for a sample word like 'PYTHON'.
💻8

Control Structures: Conditionals and Loops

Role of control structures
Control structures let a program decide which statements to run and how many times. They are the building blocks for logic in programs and enable decisions and repetition. Without them, programs would only run statements in fixed order and could not respond to inputs or perform repeated tasks.

Selection or decision making
Selection statements allow a program to branch. In Python the main forms are if, if-else, and if-elif-else. Conditions use comparison and logical operators and evaluate to True or False. For example, if marks >= 40: print('Pass') else: print('Fail'). Proper indentation identifies code belonging to each branch. Nested decisions allow more complex choice structures but keep depth moderate for clarity.

Iteration or loops
Iteration repeats a block of code. Python provides while loops and for loops. while condition: runs the block as long as the condition is true and is suitable when the number of iterations is not known in advance. for variable in sequence: iterates over elements of a sequence like a list or over a range of numbers; it is best when the number of iterations is known or driven by sequence length.

Loop control statements
break exits a loop immediately; it is useful when a result is found and further iterations are unnecessary. continue skips to the next iteration and is useful to bypass processing for certain cases. Python also supports an else clause on loops that executes when the loop completes normally (without break), although it is less commonly used by beginners.

Common patterns
Typical tasks include summing numbers in a list, counting occurrences, finding maximum/minimum, and searching for a value. For example, to search for a target in a list, use a for loop checking equality; if found, break and report position. When writing while loops, always ensure the loop variable changes and termination is reachable to avoid infinite loops.

Best practices and readability
Keep conditions simple and readable, use descriptive variable names, and avoid deeply nested structures. Where nesting becomes complex, extract logic into functions. Test loops with simple inputs and edge cases (empty lists, boundary values) to confirm correct behavior.

Integration in programs
Control structures combine with functions and data structures to solve real problems. In exams and practicals, clearly show loop initialization, condition, body and update steps in flowcharts and algorithm descriptions to gain marks and demonstrate correct thought process.

📌 Examples
  • Write a for loop to print numbers from 1 to 10 using for i in range(1,11): print(i).
  • Use while loop to find factorial of a number by multiplying and decrementing until 1.
🧮 Formulas
  1. No numeric formulas; control rules: Loop termination must be reachable; use proper increment/decrement in while loops.
📊 Visual ideas
Flowchart for a while loop: Start → Initialize → Check condition → If true then Process → Update → Loop back → Else End.
Flowchart for if-elif-else showing branching paths and convergence to end.
💻9

Functions and Modular Programming

What are functions?
Functions are named blocks of code that perform a specific task. They help break programs into smaller, manageable parts. Using functions promotes reuse, simplifies testing and debugging, and makes code easier to understand. Each function should perform a single clearly defined job and have a descriptive name.

Defining and calling functions in Python
Use the def keyword: def function_name(parameters): followed by an indented block. Parameters are placeholders for input values and the function can return a value using return. Call a function by writing its name followed by parentheses and arguments if required. For example, def add(a, b): return a + b; result = add(3, 4).

Parameters, arguments and return values
Parameters are variables listed in the function definition; arguments are actual values passed. Functions can return values to the caller or perform actions without returning (procedures). Python supports default values and keyword arguments which let callers provide parameters in any order, but for Class X focus on basic positional arguments and return values.

Scope: local vs global
Variables declared inside a function are local to that function and cannot be accessed outside. Global variables are defined at the top level and can be read inside functions; modifying them inside a function requires the global keyword. Overuse of globals makes programs harder to debug; prefer passing values as parameters and returning results.

Recursive functions (introductory)
Recursion is when a function calls itself. It is a powerful technique for some problems such as factorial or tree traversals. Every recursive function must have a base case to stop recursion; otherwise it will run until system limits cause an error. For Class X, understanding simple recursion with a clear base case is sufficient.

Advantages of modular design
Modular programs are easier to test: individual functions can be verified separately. Reuse reduces repetition, and clear interfaces between modules improve maintainability. When writing solutions for exams, dividing tasks into functions helps present clear logic and earns marks for structure.

Practical advice
Name functions clearly, keep them small, write short comments describing inputs and outputs, and test each function with sample data. Use return values rather than global variables to pass results back to the main program.

📌 Examples
  • Define a function add(a,b) that returns a+b, and call it with two numbers to display the sum.
  • Function to compute factorial using a loop: def fact(n): result=1; for i in range(1,n+1): result*=i; return result.
🧮 Formulas
  1. Function definition form: def name(parameters): <block> return value
  2. Factorial definition (mathematical): n! = n × (n-1) × ... × 1 with 0! = 1
📊 Visual ideas
Call diagram showing Main program calling functions A and B, with function A calling a helper function C.
Flowchart of a function to compute factorial showing loop or recursive steps.
📊10

Lists, Tuples and Basic Data Structures

Understanding lists
Lists are ordered collections that can hold items of different types. They are mutable—meaning their contents can change after creation. Lists are written using square brackets: [1, 'apple', 3.5]. Common operations include indexing (list[0]), slicing (list[1:3]), append() to add at the end, insert() to add at a specific position, pop() to remove an element by index, and remove() to delete by value. Lists are fundamental for storing sequences like marks, names, or sensor readings.

Tuples and their use
Tuples are similar to lists but are immutable—once created their values cannot be changed. They are defined using parentheses: (2, 3). Immutability makes tuples suitable for fixed collections such as coordinates or constants and they can be used as dictionary keys when required. Tuples often use less memory and are slightly faster for certain operations compared to lists.

Choosing between lists and tuples
Use lists when data needs to change—sorting, adding or removing elements. Use tuples when data should remain constant or represent a single record with fixed fields. Understanding the difference helps prevent accidental modification of important information.

Other simple data structures
Dictionaries (dict) store key-value pairs and are useful when you want to look up values by name, such as student marks by student ID. Sets store unique items without order and are helpful when duplicates are not desired. For Class X the primary focus is lists and tuples with a basic awareness of dicts and sets.

Operations and iteration
Iterate through lists and tuples using for loops; use len() to get the number of elements; use in operator to check membership. Nested lists can represent matrices or tables, accessed via list[row][col]. When manipulating large lists, consider complexity: appending at end is efficient, but inserting at start can be slower because elements need shifting.

Practical tasks
Typical tasks include sorting lists, searching elements using linear search, computing aggregates like sum and average, and slicing subsets. Always test with empty lists and boundary cases to avoid errors. Use list methods appropriately and prefer built-in functions like sum() and sorted() when allowed for clarity and correctness.

📌 Examples
  • nums = [10, 5, 8]; nums.append(12); print(nums) → [10,5,8,12].
  • coords = (2,3); explain that coords[0] = 2 and cannot be changed.
🧮 Formulas
  1. No numeric formulas; definitions: list = mutable ordered collection, tuple = immutable ordered collection
📊 Visual ideas
Table showing list operations and their effects: append, insert, pop, remove.
Diagram of a nested list representing a 2×3 matrix and accessing element [1][2].
✍️11

File Handling: Reading and Writing Files

Why file handling?
Files allow programs to save data permanently so information persists between runs. Instead of entering data every time, programs can store records, logs or configuration settings in files. Understanding file handling is important for practical tasks like saving student records or reading test data for processing.

Opening and modes
In Python files are opened with open(filename, mode). Modes include 'r' for read, 'w' for write (creates/overwrites), 'a' for append (adds to end), and 'r+' for read and write. Use correct mode depending on whether you need to overwrite existing data or add new data. Always handle files carefully to avoid data loss.

Safe file handling using with
The with statement manages files safely: with open('file.txt', 'r') as f: process f. Using with ensures the file is closed automatically even if errors occur. Closing files releases resources and ensures buffered data is written to disk.

Reading methods
read() reads entire file as one string—useful for small files. readline() reads one line at a time; readlines() returns a list of lines. Iterating directly over the file object for line in f: is memory-efficient for large files. Remember to strip newline characters using strip() when processing lines.

Writing to files
write() writes a string to the file; remember to include newline characters '\n' when writing multiple lines. When using 'w' mode existing content is replaced; use 'a' to append. Always ensure data is correctly formatted—comma-separated or line-separated—so it can be read back easily.

Error handling and exceptions
Use try-except blocks to catch errors like FileNotFoundError or PermissionError. With open helps reduce errors, but explicit exception handling gives better feedback and lets the program handle missing files gracefully, for example by creating a new file if needed.

Practical examples and uses
Common tasks include reading a list of names and counting entries, writing processed results such as averages to an output file, and maintaining simple logs. Files are a first step toward databases; they teach formatting, parsing and persistent storage concepts.

📌 Examples
  • Using with open('data.txt','w') as f: f.write('Hello\n') to create and write to a file safely.
  • Reading a file line by line: with open('numbers.txt') as f: for line in f: print(line.strip())
🧮 Formulas
  1. No numeric formulas; common modes: 'r', 'w', 'a', 'r+'
  2. Best practice: with open(filename, mode) as f: <operations> # automatically closes file
📊 Visual ideas
Flowchart showing file open → read/write operations → close, and error handling via try-except.
Diagram showing file pointer positions when using read() and modes like 'w' vs 'a'.
🧪12

Introduction to Simple Databases and SQL Concepts

Purpose of databases
Databases store structured information in an organised way so it can be retrieved, updated and managed reliably. Compared to plain text files, databases provide faster searching, enforce data rules, and allow many users to access and modify data concurrently. For many applications—schools, shops and websites—databases are essential for managing records efficiently.

Basic structures: tables, rows and columns
A relational database organises data into tables. Each table has columns (fields) representing attributes, and rows (records) containing specific entries. For example, a Students table might have columns StudentID, Name, Age and Class with each row representing one student’s data. A primary key is a field that uniquely identifies each record, such as StudentID.

CRUD operations
Common actions are Create, Read, Update and Delete (CRUD). These are performed using SQL (Structured Query Language). INSERT adds new records, SELECT retrieves data, UPDATE modifies records, and DELETE removes records. Filters with WHERE clause limit results to records matching conditions. ORDER BY sorts results and aggregate functions like COUNT(), SUM() help compute summaries.

Example SQL statements
CREATE TABLE Students (ID INT PRIMARY KEY, Name VARCHAR(50), Age INT); INSERT INTO Students (ID, Name, Age) VALUES (1, 'Asha', 14); SELECT Name FROM Students WHERE Age > 13 ORDER BY Name; UPDATE Students SET Age = 15 WHERE ID = 1; DELETE FROM Students WHERE ID = 1. These commands show how to create tables and manipulate data within them.

Keys and relationships
Primary keys uniquely identify rows. Foreign keys relate records between tables; for example, ClassID in Students can link to an entry in a Classes table. Normalisation is the process of organising tables to reduce redundancy—breaking data into related tables and linking them by keys. While in Class X focus on simple tables and queries, understanding basic relationships helps design structured datasets.

Practical uses and benefits
Databases power everyday systems: school result systems, library records, online stores and more. Learning basic SQL prepares students for practical database tasks and helps them think about how data is organised and queried. Knowledge of simple SQL commands is often tested in exams and is useful in practical assignments.

📌 Examples
  • SQL example: INSERT INTO Students (StudentID,Name,Age) VALUES (1,'Asha',14).
  • SQL query: SELECT * FROM Students WHERE Age>13 ORDER BY Name;
🧮 Formulas
  1. No numeric formulas; key commands: SELECT, INSERT, UPDATE, DELETE, WHERE, ORDER BY
  2. Primary key: a field or combination of fields that uniquely identifies each record
📊 Visual ideas
Table layout showing columns and rows for a Students table with sample records.
ER-like sketch showing Students table linked to Classes table by ClassID (conceptual).
💻13

Basic HTML: Structure of a Web Page

What HTML does
HTML (HyperText Markup Language) provides the structure of web pages. It does not style pages in detail; rather it marks up content so browsers can display headings, paragraphs, lists, images and links. HTML uses tags enclosed in angle brackets; each tag may have attributes that provide extra information.

Document structure
A simple HTML document begins with a doctype declaration to inform the browser of the HTML version. The root element html contains two sections: head and body. The head includes metadata such as title, character set and links to stylesheets. The body contains visible content—headings, paragraphs, lists, tables and images.

Common tags and attributes
Headings use h1 to h6 with h1 the most important. Paragraphs use p. Links use a href="URL"text

Images and media
The img tag embeds images with src attribute pointing to the file and alt attribute describing the image for accessibility. Always provide alt text to help users with screen readers and to improve SEO.

Lists and tables
Use ul for unordered lists and ol for ordered lists, with items in li. Tables are built with table, rows with tr and cells with td. Tables are good for tabular data but not for layout—use them only for actual tables of data.

Links and navigation
Hyperlinks connect pages; use absolute URLs for external sites and relative paths for pages within the same site. Use the target attribute to open links in new windows if needed, but prefer default behavior for accessibility.

Semantic and accessible HTML
Use tags semantically: headings for structure, paragraphs for text, lists for grouped items. Proper semantic markup improves usability and accessibility. Close tags correctly, nest elements properly and use meaningful alt text and titles to make pages more accessible and easier to maintain.

📌 Examples
  • Create a basic HTML page with a title, a heading, a paragraph, and a link to another page.
  • Make an unordered list of favourite subjects using <ul> and <li> tags.
🧮 Formulas
  1. No numeric formulas; syntax rule: Tags use <tag>content</tag> with attributes inside the opening tag.
  2. Example: <a href="http://example.com">Visit</a>
📊 Visual ideas
Diagram of HTML document tree: html → head (title) and body (h1, p, ul, table etc.).
Sketch of a simple web page layout showing header, navigation link, content paragraph, and image placement.
⚙️14

Introduction to Computer Networks and Internet

What is a computer network?
A computer network connects two or more devices to share resources and information. Networks make it possible to share files, printers and internet connections, and enable communication through email and messaging. Understanding basic networking concepts helps students see how computers interact and why internet services work the way they do.

Network types by scale
PAN (Personal Area Network) connects personal devices around a person, like a phone and headset. LAN (Local Area Network) covers a small area such as a classroom or school and usually offers high-speed connections. WAN (Wide Area Network) spans large geographic areas and connects LANs over long distances, often using leased lines or the internet.

Common topologies and devices
Physical topology describes how devices are connected: star topology has a central switch or hub connecting nodes; bus topology has a single shared channel; ring topology connects devices in a circular fashion. Network devices include switches (connect multiple devices within a LAN), routers (route data between networks and connect to the internet), modems (convert digital signals to carrier signals for transmission over phone or cable lines) and access points (provide wireless connections).

The Internet and WWW
The internet is a global network of networks. The World Wide Web (WWW) is a service on the internet that uses HTTP to access hyperlinked documents. Web browsers request pages from web servers using URLs. DNS (Domain Name System) translates human-friendly names (like example.com) into IP addresses required for routing.

IP addressing and basic routing
Every device on a network has an IP address that identifies it uniquely on that network. Routers use IP addresses to forward packets across networks. For many home and school networks, devices receive IP addresses automatically from a DHCP server—often built into the router. Knowledge of IP addressing and DNS is useful for troubleshooting connectivity problems.

Security and safe practices
Secure networks use encryption (WPA2/WPA3 for Wi-Fi) and strong passwords to prevent unauthorised access. Firewalls and antivirus tools add protection. Be cautious connecting to public Wi-Fi and avoid sharing sensitive data over insecure connections. Understanding basic network security reduces risks of data theft and unauthorised access.

📌 Examples
  • Explaining how sending an email involves your device connecting to an SMTP server via the internet and the recipient fetching it via IMAP/POP.
  • Describing a home Wi-Fi setup with modem connected to ISP and a router providing wireless access to multiple devices.
🧮 Formulas
  1. No numeric formulas; key definitions: LAN, WAN, Router, Switch, DNS, IP address
📊 Visual ideas
Topology sketches: star and bus networks with labeled central device and connected nodes.
Simple diagram showing a home network: ISP → Modem → Router → multiple devices (PC, phone).
💻15

Cyber Safety and Digital Citizenship

Importance of cyber safety
As students use the internet for study and social life, understanding safe digital behaviour is essential. Cyber safety prevents misuse of personal information, protects against scams and reduces the risk of cyberbullying. Being a responsible digital citizen helps maintain a positive online presence and protects others as well.

Protecting personal information
Avoid sharing sensitive personal details online such as full address, phone number, bank details or private images. Use privacy settings on social media to control who sees your posts. Think before sharing—once something is online it can be copied and difficult to remove. Use strong, unique passwords for different accounts and enable two-factor authentication when available.

Recognising online threats
Phishing attempts come as emails or messages that appear legitimate but ask for passwords or money. Suspicious links, unexpected attachments and urgent requests are common signs of phishing. Malware can infect devices through downloads or unsafe websites; keep antivirus software updated and avoid installing unknown programs. Scams often exploit fear or urgency—take time to verify requests through separate channels.

Safe social media conduct
Maintain a respectful tone online and avoid posting or sharing hurtful content. Do not engage in cyberbullying. Think about how posts reflect on future opportunities—colleges and employers may view online behaviour. Accept friend requests only from people you know, and be cautious about location sharing and real-time check-ins which reveal your whereabouts.

Ethics, copyright and plagiarism
Respect intellectual property by citing sources and not copying others’ work without permission. Use free or licensed resources correctly and learn basic citation practices. When using images, music or text from the web, check licensing and give credit where required.

Responding to threats and seeking help
If you receive threatening messages or face cyberbullying, save evidence, block the offender and report to the platform or a trusted adult. For financial or identity threats, inform parents and banks promptly. Schools usually have policies and support resources—use them. Practising safe habits and reporting problems early reduces harm and helps create a safer online community.

📌 Examples
  • Identifying a phishing email: urgent language, unknown sender, suspicious links; never click and verify via other channels.
  • Creating a strong password example: use a mix of letters, numbers, and symbols, and avoid common words like 'password123'.
📊 Visual ideas
Checklist diagram showing steps: Verify sender → Do not click suspicious links → Report → Block.
Flowchart for responding to cyberbullying: Save evidence → Tell trusted adult → Report to platform → Seek help.
💻16

Problem Solving: Putting It All Together

Structured approach to solving problems
Begin by reading the problem carefully and identifying inputs, required outputs and constraints. Work out small examples by hand to understand expected behaviour. Breaking a problem into subtasks makes it more manageable—list subtasks and decide the order. This way you can focus on implementing and testing one piece at a time.

Design before coding
Create an algorithm or write pseudocode describing each step. Draw a flowchart for visual clarity when decisions and loops are involved. Choose data structures that fit the task: lists for ordered collections, variables for single values, files for persistent storage. Decide whether functions are needed to modularise code.

Translating design into Python
Convert each algorithm step into Python statements. Write small functions for repeated tasks. Use meaningful names and comments to explain non-obvious logic. Test individual functions with sample inputs before integrating them into the main program. If the problem involves files or databases, mock small datasets to validate reading and writing steps.

Testing and debugging
Test with normal, boundary and edge cases: empty input, maximum/minimum values, and unexpected data types. Use print statements or debugging tools to trace variable values. Fix syntax errors first as they prevent execution; then locate logical errors by tracing program flow. When stuck, simplify the problem and test smaller parts.

Optimisation and clarity
For Class X, correctness and clarity are priority. Avoid premature micro-optimisations. Use simple, readable constructs and built-in functions where appropriate. Keep code modular: smaller functions are easier to test and reuse. Present algorithm, flowchart and code clearly in exams to gain marks for each part of the solution.

Practical problem examples
Common exercises include: computing sums and averages, searching for items in lists, counting occurrences, basic string manipulation, and reading/writing data from files. Practice with such problems consolidates the link between algorithmic thinking and programming implementation. Always comment sample runs and show expected output to demonstrate correct functioning.

📌 Examples
  • Problem: Given marks of students in a list, compute average and highest mark — show algorithm, flowchart, and Python code.
  • Problem: Read names from a file and output names starting with letter 'A' — algorithm, file handling steps, and code snippet.
🧮 Formulas
  1. Average formula: average = sum of items / number of items
  2. Linear search steps: check each element sequentially until found or list ends
📊 Visual ideas
Flowchart showing problem-solving steps: Understand → Design → Implement → Test → Refine.
Example flowchart for searching an item in a list using linear search structure.
💻17

Practical Project Ideas and Documentation

Why small projects matter
Projects combine many topics: algorithms, programming, file handling, simple databases and presentation using HTML. They give practical experience in planning, implementing and documenting a deliverable. Projects are also useful for practical exams and help demonstrate hands-on ability beyond theory.

Selecting an appropriate project
Choose a project that fits available time and skills. Small, well-finished projects score better than large unfinished ones. Examples include: a Student Record Manager with file-based storage, a Quiz Application that reads questions from a file, a Simple Calculator or a small HTML portfolio site. Clearly define scope and features before starting to avoid scope creep.

Project design steps
1. Title and objective: state what the project does. 2. Requirements: list software, hardware and data formats. 3. Design: include algorithms, flowcharts and data structures. 4. Implementation: write modular code with functions and comments. 5. Testing: use sample data and edge cases. 6. Deployment: instructions to run the project. 7. Maintenance: note known issues and how to improve.

Documentation essentials
Good documentation explains what the project does and how to use it. Include an introduction, features, installation steps, user guide with examples, source code listing with explanations, test cases with results, and screenshots if applicable. A readme file summarises how to run the project and lists dependencies. Proper documentation helps teachers evaluate work and shows professionalism.

Presentation and submission
Present the project clearly: a cover page, table of contents, and numbered sections help navigation. Provide code files, sample input/output and any required data. Keep backup copies and version history to recover earlier work if needed. If working in a group, document individual contributions and acknowledge any external resources used.

Evaluation criteria
Projects are judged on functionality, correctness, code quality, documentation, testing and presentation. Ensure core features work correctly before adding extras. Clean, modular code with comments and clear user instructions gains marks. Demonstrating testing and handling common errors improves reliability and scoring.

📌 Examples
  • Project outline for a Student Record Manager: features include add, view, search, update, delete records using file storage.
  • Simple HTML portfolio website project with pages Home, About, and Contact linking between pages.
📊 Visual ideas
Project planning Gantt-like sketch showing timeline: Design → Coding → Testing → Documentation.
Module diagram showing main program and helper modules/functions with data flow arrows.
🔶18

Revision of Common Exam Patterns and Marking Scheme

Types of exam questions
Computer Applications exams commonly include short answer theory questions, longer explanatory questions, algorithm and flowchart design, and programming tasks with required input/output formats. Practical exams may ask students to write programs, run them on given inputs and submit working code files. Understanding the question types helps allocate time and present answers in the expected format.

How marks are awarded
Marks are typically distributed across understanding concepts, correct algorithms/flowcharts, correct program logic and syntax, sample runs, and documentation. Partial marks may be given for a correct approach even if the code has minor syntax errors; showing clear algorithm and logic gains credit. For practicals, working programs with correct output and clear code comments are valued.

Presenting programming answers
When answering a programming question on paper, include: a short algorithm or pseudocode, a neat flowchart, the source code with comments and at least one sample input and output. Use proper indentation and meaningful variable names. Explain any assumptions like input ranges. This structured answer demonstrates understanding and helps examiners follow your logic.

Practical exam tips
Save work frequently and test with sample input before final submission. Follow the exact input/output format specified in the question; minor differences in formatting can lose marks. Name files as instructed and include a short readme explaining how to run the program. If stuck, submit partial working code with comments about intended remaining steps.

Time management strategies
Read the entire paper first and allocate time based on marks. Start with questions you know well to secure marks early. Leave time for checking and correcting small errors. For programming questions, write the algorithm and flowchart quickly, then implement and test—this sequence reduces mistakes and improves clarity.

Common mistakes to avoid
Typical errors include not following input/output formats, missing edge cases, poor indentation or unclear variable names, and skipping test runs. Avoid copying code without understanding and ensure you can explain the logic in brief. Practise previous question papers and sample tasks to build confidence and speed.

📌 Examples
  • Show how to present a programming answer: give algorithm, flowchart, source code, and sample input/output.
  • Illustrate marking: algorithm correct (4/5), program syntax error (2/5), sample run correct (3/5) = total marks example.
📊 Visual ideas
Checklist diagram of steps to answer a programming question: Read → Design → Code → Test → Save → Submit.
Pie chart-style sketch showing time allocation for exam sections based on marks (conceptual).

Key Concepts

Algorithm
A finite sequence of clear, ordered steps to solve a problem.
Flowchart
A diagram using symbols to represent the sequence and decision points of an algorithm.
CPU
Central Processing Unit; the component that executes instructions and processes data.
RAM
Random Access Memory; volatile memory used to hold data and programs currently in use.
Operating System
System software that manages hardware resources and provides services to applications.
Variable
A name that refers to a storage location holding a value that can change during program execution.
Data Type
A classification that specifies the kind of values a variable can hold, like int or str.
List
An ordered, mutable collection of items in Python.
Function
A named block of code designed to perform a specific task and optionally return a value.
File Handling
Techniques to create, read, write, and close files to store data permanently.
SQL
Structured Query Language used to manage and query relational databases.
HTML
Markup language used to structure content on web pages using tags.
IP Address
A numeric label assigned to each device on a network to identify and locate it.
Phishing
A cyber-attack that attempts to obtain sensitive information by disguising as a trustworthy entity.
Modular Programming
Breaking a program into separate functions or modules to improve readability and reuse.

Practice Questions

  1. Write an algorithm and draw a flowchart to find the largest of three numbers. / तीन संख्याओं में सबसे बड़ी संख्या ज्ञात करने के लिए एक एल्गोरिथ्म लिखिए और उसका फ्लोचार्ट बनाइए।
    Show answer

    Algorithm (English): 1. Start. 2. Read numbers a, b, c. 3. Assume max = a. 4. If b > max then max = b. 5. If c > max then max = c. 6. Print max. 7. End. / एल्गोरिथ्म (हिन्दी): 1. शुरू करें। 2. संख्याएँ a, b, c पढ़ें। 3. मान लीजिए max = a। 4. यदि b > max तो max = b। 5. यदि c > max तो max = c। 6. max प्रिंट करें। 7. समाप्त।

  2. Write a Python program to read five numbers into a list and print their average. / पाँच संख्याएँ एक सूची में पढ़कर उनका औसत प्रिंट करने का Python प्रोग्राम लिखिए।
    Show answer

    English answer: nums = [] for i in range(5): n = float(input()) nums.append(n) avg = sum(nums)/len(nums) print(avg) Hindi answer: अंग्रेज़ी कोड का अर्थ: पांच मान पढ़कर उन्हें सूची nums में जोड़ते हैं, sum() से योग निकालकर len() से भाग देकर औसत avg निकाला और उसे प्रिंट किया।

  3. What are the main functions of an Operating System? List four. / ऑपरेटिंग सिस्टम के मुख्य कार्य क्या हैं? चार लिखिए।
    Show answer

    English answer: Main functions include: 1. Process management (scheduling and execution), 2. Memory management (allocating and deallocating RAM), 3. File system management (organising and accessing files), 4. Device management (handling I/O devices via drivers). / हिन्दी उत्तर: मुख्य कार्य हैं: 1. प्रक्रिया प्रबंधन (शेड्यूलिंग और निष्पादन), 2. स्मृति प्रबंधन (RAM आवंटन/मुक्ति), 3. फ़ाइल प्रणाली प्रबंधन (फाइलों का संगठन और पहुँच), 4. डिवाइस प्रबंधन (I/O डिवाइस के लिए ड्राइवरों के माध्यम से नियंत्रण)।

  4. Explain the difference between list and tuple in Python with one example each. / Python में list और tuple के बीच अंतर स्पष्ट कीजिए और एक-एक उदाहरण दीजिए।
    Show answer

    English answer: Difference: A list is mutable (can be changed) while a tuple is immutable (cannot be changed after creation). Example list: nums = [1,2,3]; nums.append(4) → [1,2,3,4]. Example tuple: coords = (2,3); attempting coords[0]=5 causes an error. / हिन्दी उत्तर: अंतर: list परिवर्तनीय है, tuple अपरिवर्तनीय है। उदाहरण list: nums = [1,2,3]; nums.append(4) → [1,2,3,4]. उदाहरण tuple: coords = (2,3); coords[0]=5 करने पर त्रुटि होगी।

  5. Give SQL commands to (a) create a table Students with fields ID, Name, Age and (b) select names of students older than 14. / SQL कमांड लिखिए: (a) ID, Name, Age फ़ील्ड के साथ Students तालिका बनाइए और (b) 14 वर्ष से अधिक आयु वाले छात्रों के नाम चुनिए।
    Show answer

    English answer: (a) CREATE TABLE Students (ID INT PRIMARY KEY, Name VARCHAR(50), Age INT); (b) SELECT Name FROM Students WHERE Age > 14; / हिन्दी उत्तर: (a) CREATE TABLE Students (ID INT PRIMARY KEY, Name VARCHAR(50), Age INT); (b) SELECT Name FROM Students WHERE Age > 14;

  6. Describe three measures to stay safe online. / ऑनलाइन सुरक्षित रहने के तीन उपाय बताइए।
    Show answer

    English answer: 1. Use strong, unique passwords and enable two-factor authentication. 2. Do not click suspicious links or open unknown attachments; verify senders. 3. Keep software and antivirus updated and use privacy settings on social media. / हिन्दी उत्तर: 1. मजबूत और अलग-अलग पासवर्ड का उपयोग करें तथा दो-कारक प्रमाणीकरण सक्रिय करें। 2. संदिग्ध लिंक पर न क्लिक करें और अज्ञात अटैचमेंट न खोलें; प्रेषक सत्यापित करें। 3. सॉफ़्टवेयर और एंटिवायरस अपडेट रखें तथा सोशल मीडिया पर गोपनीयता सेटिंग्स का प्रयोग करें।

  7. What is the output and why? Python code: x = 5 if x>2: print('A') else: print('B') print('Done') / इस कोड का आउटपुट क्या होगा और क्यों? (कोड दिया गया है) x = 5 ...
    Show answer

    English answer: Output will be: A Done Because x is 5 which is greater than 2, so the if block prints 'A'; after the conditional the program proceeds to print 'Done'. / हिन्दी उत्तर: आउटपुट होगा: A Done क्योंकि x = 5 है जो 2 से बड़ा है, इसलिए if ब्लॉक 'A' प्रिंट करेगा; तत्पश्चात 'Done' प्रिंट होगा।

  8. Explain with example how to read a text file and count number of lines in Python. / Python में किसी टेक्स्ट फ़ाइल को पढ़कर उसकी पंक्तियों की संख्या कैसे गिनते हैं, उदाहरण के साथ समझाइए।
    Show answer

    English answer: Use with open('file.txt','r') as f: count=0; for line in f: count += 1; print(count). This opens the file safely, iterates over each line increasing count, then prints the total. / हिन्दी उत्तर: with open('file.txt','r') as f: count=0; for line in f: count += 1; print(count). यह फ़ाइल को सुरक्षित रूप से खोलता है, हर पंक्ति पर जाकर गिनती बढ़ाता है और कुल संख्या प्रिंट करता है।

  9. Design a flowchart and write pseudocode to check whether a number is prime. / किसी संख्या के अभाज्य (prime) होने की जाँच करने के लिए फ्लोचार्ट डिज़ाइन करें और उसका छद्मकोड लिखिए।
    Show answer

    English answer (pseudocode): Start; Read n; if n<=1 then print 'Not Prime' and End; set i=2; prime=True; while i <= sqrt(n): if n % i == 0 then prime=False; break; i=i+1; if prime then print 'Prime' else print 'Not Prime'; End. (Flowchart: Start → Input n → Check n<=1 decision → Initialize i=2 → Loop decision i<=sqrt(n) → Check n%i==0 decision → set prime false and break or i=i+1 → After loop print result → End) / हिन्दी उत्तर (छद्मकोड): शुरू; n पढ़ें; यदि n<=1 तो 'Not Prime' प्रिंट करें और समाप्त; i=2 सेट करें; prime=True; जब तक i <= sqrt(n) करें: यदि n % i == 0 तो prime=False; ब्रेक; i=i+1; यदि prime तो 'Prime' अन्यथा 'Not Prime' प्रिंट करें; समाप्त। फ्लोचार्ट में उपर्युक्त स्टेप्स के निर्णय और लूप ब्लॉक्स दिखाएँ।

Related Laws & Principles

Explore all

Foundational laws & principles connected to this chapter — tap to open in the Laws Explorer.

Loading related laws…
Sourced from 0 content files · LLOS Learn · browse all chapters