Day 20 – Chapter 3: Programming Languages
Class 11 Computer Science
3.23 Introduction to Programming Languages (प्रोग्रामिंग भाषाओं का परिचय)
A programming language is a formal language used to communicate instructions to a computer. It enables programmers to write code to develop software applications.
प्रोग्रामिंग भाषा एक औपचारिक भाषा है जिसका उपयोग कंप्यूटर को निर्देश देने के लिए किया जाता है। यह प्रोग्रामर को सॉफ़्टवेयर अनुप्रयोग विकसित करने के लिए कोड लिखने में सक्षम बनाती है।
3.24 Types of Programming Languages (प्रोग्रामिंग भाषाओं के प्रकार)
3.24.1 Low-Level Languages (लो-लेवल भाषाएँ)
Low-level languages are close to machine code and provide minimal abstraction from the hardware.
लो-लेवल भाषाएँ मशीन कोड के करीब होती हैं और हार्डवेयर से न्यूनतम अमूर्तता प्रदान करती हैं।
- Machine Language: Written in binary code; directly understood by the computer.
- Assembly Language: Uses symbolic instructions and is converted to machine code using an assembler.
Example: ADD A, B (Assembly Language)
3.24.2 High-Level Languages (हाई-लेवल भाषाएँ)
High-level languages are user-friendly and provide abstraction from hardware. They use natural language elements.
हाई-लेवल भाषाएँ उपयोगकर्ता-अनुकूल होती हैं और हार्डवेयर से अमूर्तता प्रदान करती हैं। इनमें प्राकृतिक भाषा तत्वों का उपयोग होता है।
- Examples: C, C++, Java, Python
Features:
- Portable and easy to debug
- Readable syntax
- Platform-independent (in some cases)
3.25 Translators (ट्रांसलेटर्स)
Translators are programs that convert high-level or assembly code into machine language.
ट्रांसलेटर्स ऐसे प्रोग्राम हैं जो हाई-लेवल या असेंबली कोड को मशीन भाषा में परिवर्तित करते हैं।
Types of Translators (ट्रांसलेटर्स के प्रकार):
- Compiler: Converts the entire program into machine code at once.
- Interpreter: Translates and executes code line-by-line.
- Assembler: Converts assembly language into machine code.
Example: A compiler is used to convert C++ code into an executable file.
3.26 Comparison of Low-Level and High-Level Languages (लो-लेवल और हाई-लेवल भाषाओं की तुलना)
| Aspect (पहलू) | Low-Level Language (लो-लेवल भाषा) | High-Level Language (हाई-लेवल भाषा) |
|---|---|---|
| Abstraction | Minimal | High |
| Ease of Use | Difficult | Easy |
| Speed | Faster | Relatively slower |
| Examples | Machine Language, Assembly | C, Java, Python |
Practice Questions (अभ्यास प्रश्न)
Multiple Choice Questions (MCQs)
- Which language is closest to machine code?
(a) High-Level Language | (b) Assembly Language | (c) Low-Level Language | (d) Python - What does an interpreter do?
(a) Converts the entire code at once | (b) Translates code line-by-line | (c) Compiles machine code | (d) None of the above - Which of the following is a high-level language?
(a) Machine Language | (b) Assembly Language | (c) Java | (d) Binary Code - What is the function of a compiler?
(a) Translates assembly code | (b) Converts high-level code into machine code | (c) Executes code line-by-line | (d) Stores machine code - Which is an example of a low-level language?
(a) Python | (b) C++ | (c) Assembly | (d) HTML - What is the primary benefit of high-level languages?
(a) Close to hardware | (b) Easy to debug and portable | (c) Faster execution | (d) Minimal abstraction - Which translator is used for assembly language?
(a) Interpreter | (b) Compiler | (c) Assembler | (d) All of the above - Which type of language is used for hardware-level programming?
(a) High-Level Language | (b) Low-Level Language | (c) Scripting Language | (d) None of the above - Which translator converts code line-by-line?
(a) Compiler | (b) Interpreter | (c) Assembler | (d) Debugger - Which language is platform-independent?
(a) Machine Language | (b) Assembly Language | (c) High-Level Language | (d) None of the above
Answers to MCQs:
1: (c), 2: (b), 3: (c), 4: (b), 5: (c), 6: (b), 7: (c), 8: (b), 9: (b), 10: (c)
Short Answer Questions (लघु उत्तरीय प्रश्न)
- What is a programming language?
Answer: A formal language used to write instructions for a computer. - What are the types of programming languages?
Answer: Low-Level (Machine, Assembly) and High-Level (C, Java, Python). - What is the role of a compiler?
Answer: Converts the entire high-level program into machine code at once. - Differentiate between low-level and high-level languages.
Answer: Low-level is hardware-specific; high-level is user-friendly and portable. - What are the types of translators?
Answer: Compiler, Interpreter, Assembler.
Long Answer Questions (दीर्घ उत्तरीय प्रश्न)
- Explain low-level and high-level languages with examples.
- Discuss the types and functions of translators in programming.
- Compare the features of low-level and high-level programming languages.
Post a Comment