Programming Languages — Set 4
Computers · प्रोग्रामिंग भाषाएं · Questions 31–40 of 60
In computer languages, which term describes the rules that govern the formation of valid statements?
Correct Answer: D. Syntax
• **Syntax** = the complete rulebook that dictates how symbols, keywords, and statements must be arranged for a program to be valid — violate even one rule and the compiler immediately throws an error and refuses to run the code. • **Why syntax matters** — it is the machine-readable equivalent of grammar in human language; just as a sentence with wrong grammar confuses a reader, wrong syntax confuses the compiler. • Syntax covers punctuation, bracket placement, keyword order, and spacing rules — all must be exact. • 💡 Option A (Semantics) is wrong because semantics deals with the *meaning* of statements, not their structure; Option B (Algorithms) is wrong because algorithms are step-by-step problem-solving procedures, not language rules; Option C (Logic) is wrong because logic refers to reasoning and conditions within code, not the formatting rules of the language.
Which of these languages is a 'Scripting' language often used for server-side web logic?
Correct Answer: D. PHP
• **PHP** = a server-side scripting language specifically designed for web development; it runs on the web server, dynamically generates HTML pages, and sends them to the visitor's browser — the user never sees the PHP code itself. • **Real-world dominance** — over 75% of all websites with a known server-side language use PHP, including platforms like WordPress, Facebook (originally), and Wikipedia. • PHP stands for Hypertext Preprocessor and supports databases, session management, and form handling natively. • 💡 Option A (C#) is wrong because C# is a general-purpose compiled language primarily used for Windows apps and games (Unity), not scripting; Option B (Assembly) is wrong because Assembly is a low-level hardware language with no web application role; Option C (Fortran) is wrong because Fortran is a scientific computing language developed for numerical calculations, not web servers.
Which language was developed by JetBrains and is now the preferred language for Android development?
Correct Answer: A. Kotlin
• **Kotlin** = a statically typed language developed by JetBrains (makers of IntelliJ IDEA) that is 100% interoperable with Java — existing Java code and Kotlin code can coexist in the same Android project without any conflict. • **Google's official backing** — Google declared Kotlin a first-class Android language in 2017 and the *preferred* language in 2019, meaning new Android documentation and samples are written in Kotlin first. • Kotlin eliminates common Java pitfalls like NullPointerException through built-in null safety, making apps more stable. • 💡 Option B (Dart) is wrong because Dart is used for Flutter, Google's cross-platform UI framework, not native Android; Option C (Scala) is wrong because Scala runs on the JVM but is primarily used for big data (Apache Spark), not Android; Option D (Swift) is wrong because Swift is Apple's language for iOS/macOS, not Android.
What is the primary function of an 'Assembler'?
Correct Answer: B. To convert assembly language to machine code
• **Assembler** = a translation program that converts human-readable Assembly language mnemonics (like MOV, ADD, JMP) into binary machine code that the CPU can directly execute — it is the bridge between symbolic instructions and raw hardware commands. • **One-to-one mapping** — each Assembly instruction corresponds to exactly one machine-code instruction, which is why Assembly gives programmers fine-grained control over hardware. • Because Assembly is CPU-specific, each processor architecture (x86, ARM, RISC-V) requires its own dedicated assembler. • 💡 Option A (To convert machine code to assembly) is wrong because that is the job of a *disassembler*, not an assembler; Option C (To link different programs) is wrong because linking is done by a *linker*, which combines compiled object files; Option D (To execute high-level code) is wrong because that describes an interpreter's role with languages like Python.
Which language is frequently used in scientific research for statistical analysis and machine learning along with Python?
Correct Answer: B. R
• **R** = a free, open-source programming language and environment built specifically for statistical computing, data analysis, and graphical visualization — it is the tool of choice in academia, biostatistics, genomics, and social science research alongside Python. • **Rich ecosystem** — R has over 18,000 packages on CRAN (Comprehensive R Archive Network), covering everything from time-series analysis to machine learning models like random forests. • R was created in 1993 at the University of Auckland as a cleaner, open-source implementation of the proprietary S language. • 💡 Option A (FORTRAN) is wrong because FORTRAN is used for high-performance numerical computation in physics and engineering, not general statistical research; Option C (SQL) is wrong because SQL is a database query language for retrieving and managing structured data, not for statistical modelling; Option D (Ada) is wrong because Ada is a safety-critical language used in aviation and defence systems, not data science.
Which programming language category does 'C++' fall into, given its focus on classes and objects?
Correct Answer: B. Object-Oriented
• **Object-Oriented** = a programming paradigm that organises code around *objects* — self-contained units that bundle data (attributes) and functions (methods) together — and C++ was among the first languages to bring this paradigm to high-performance system-level programming. • **OOP pillars in C++** — encapsulation hides internal data, inheritance allows one class to extend another, polymorphism lets the same function behave differently for different objects, and abstraction simplifies complex systems. • C++ was designed by Bjarne Stroustrup in the early 1980s by adding OOP features directly on top of C, giving developers both speed and structure. • 💡 Option A (Procedural) is wrong because procedural languages like plain C follow a top-down sequence of function calls without objects; Option C (Functional) is wrong because functional languages like Haskell treat computation as evaluation of mathematical functions, avoiding mutable state; Option D (Logic) is wrong because logic languages like Prolog use facts and rules to derive conclusions, not objects.
Which language is the primary language used for programming iOS applications for iPhones?
Correct Answer: A. Swift
• **Swift** = Apple's modern, safe, and expressive programming language introduced in 2014; it is the primary language for building apps on iOS (iPhone), macOS, watchOS, and tvOS, replacing the older Objective-C. • **Safety by design** — Swift prevents common programming errors through features like optional types (which force explicit handling of nil values) and type inference, reducing crashes in production apps. • Swift is open-source and has been adopted beyond Apple platforms, with server-side Swift frameworks like Vapor gaining traction. • 💡 Option B (Java) is wrong because Java is the traditional language for Android development, not iOS — Apple's ecosystem does not use Java; Option C (Kotlin) is wrong because Kotlin is Google's preferred language for Android, not for Apple's platforms; Option D (C#) is wrong because C# is Microsoft's language used in .NET applications and game development with Unity, not iOS apps.
Which of these is considered a 'High-Level' language?
Correct Answer: C. Python
• **Python** = a high-level language because it uses English-like keywords (print, if, while) and abstracts away all hardware details, letting programmers focus on problem-solving rather than managing memory addresses or CPU registers. • **Hardware independence** — high-level languages are platform-independent; the same Python script runs on Windows, Linux, or macOS without any changes, unlike low-level code tied to a specific processor. • High-level languages must be translated to machine code by a compiler or interpreter before the CPU can execute them. • 💡 Option A (Binary Code) is wrong because binary code IS machine language — the lowest level, directly read by the CPU with no translation needed; Option B (Assembly Code) is wrong because Assembly is a second-generation low-level language that still maps closely to machine instructions; Option D (Hexadecimal Code) is wrong because hexadecimal is just a compact human-readable notation for binary machine code, not a programming language.
Which language was originally known as 'Oak' before it was renamed?
Correct Answer: B. Java
• **Java** = originally named 'Oak' when James Gosling began developing it at Sun Microsystems in 1991 for embedded systems and interactive TV; the name was changed to Java (after Java coffee) because 'Oak' was already a registered trademark of Oak Technologies. • **Pivot to the web** — when the internet boomed in the mid-1990s, Java's 'write once, run anywhere' philosophy made it perfectly suited for web applets, and it quickly became a dominant platform language. • Java's mascot is Duke, and its tagline 'Write Once, Run Anywhere' refers to the Java Virtual Machine (JVM) that runs the same bytecode on any OS. • 💡 Option A (C++) is wrong because C++ was developed by Bjarne Stroustrup at Bell Labs and was never called Oak; Option C (Python) is wrong because Python was created by Guido van Rossum in 1991 and was named after Monty Python, not Oak; Option D (Perl) is wrong because Perl was created by Larry Wall in 1987 as a text-processing language and has no connection to the name Oak.
What does 'OOP' stand for in the context of programming methodologies?
Correct Answer: B. Object-Oriented Programming
• **OOP = Object-Oriented Programming** — a software design paradigm where code is organised into *objects* that combine data (fields/attributes) and behaviour (methods) into a single reusable unit, making large applications easier to build and maintain. • **Four pillars** — Encapsulation (hiding internal data), Inheritance (child classes reusing parent class code), Polymorphism (one interface, many implementations), and Abstraction (exposing only essential features). • OOP became dominant from the 1990s onward; today, languages like Java, C++, Python, and C# are all built around this paradigm. • 💡 Option A (Online Operation Process) is wrong because it is a completely fabricated phrase with no meaning in computing; Option C (Open Origin Protocol) is wrong because it sounds like a network protocol but is not a real term; Option D (Output Oriented Path) is wrong because it is also a made-up phrase — only Object-Oriented Programming is the actual expansion.