Computer Knowledge

Programming Languages and Compilers

1,170 Questions

Programming languages and compilers involve the rules, syntax, and semantics used to write and execute software programs. Key areas include scripting languages, object oriented concepts, and parsing algorithms like top down parsers. Practice these computer science questions to build proficiency for technical and computer knowledge exams.

Object oriented languagesScripting languagesCompilers and parsersProgramming syntax

Programming Languages and Compilers Questions

Multiple choice technology programming languages
  1. C language

  2. Java Language

  3. C# language

  4. B language

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

To solve this question, the user needs to know the concept of subsets, i.e., a subset is a part of a larger set. The user must identify which language(s) are a subset of C++.

Now, let's go through each option and explain why it is right or wrong:

A. C language: This option is correct. C++ is an extension of the C language, which means that all C programs are also C++ programs. Therefore, C is a subset of C++.

B. Java Language: This option is incorrect. Java is not a subset of C++. Although both languages share some similarities, they are distinct programming languages with different syntax and features.

C. C# language: This option is incorrect. C# is not a subset of C++. C# is a programming language developed by Microsoft and is not related to C++.

D. B language: This option is incorrect. B language is not a subset of C++. B language was developed in the early 1970s and is not widely used today.

The Answer is: A. C language

Multiple choice technology programming languages
  1. Statically typed language

  2. Dynamically typed language

  3. Both Statically and dynamically typed language

  4. Type-less language

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

C++ is a statically typed language, meaning variable types are checked and enforced at compile time. This is different from dynamically typed languages where types are checked at runtime. The language is neither type-less nor both statically and dynamically typed.

Multiple choice technology programming languages
  1. C++ programs are directly compiled into native code by a compiler

  2. C++ programs are first compiled to intermediate code by a compiler and then executed by a virtual machine

  3. C++ programs are interpreted by an interpreter

  4. A C++ editor directly compiles and executes the program

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

C++ is a compiled language that directly translates source code into native machine code without an intermediate bytecode step. Unlike Java or C#, which use virtual machines to execute intermediate code, C++ compilers generate platform-specific executables. Editors are development tools, not execution mechanisms.

Multiple choice technology programming languages
  1. C

  2. C++

  3. QBASIC

  4. FORTRAN

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

FORTRAN (FORmula TRANslation), developed by IBM and John Backus's team and released in 1957, was the first widely successful high-level programming language. It enabled scientists and engineers to write code using mathematical notation rather than assembly or machine code. C (1970s) and C++ (1980s) came decades later, while QBASIC was a 1990s educational language.

Multiple choice technology programming languages
  1. A type of coffee

  2. An object-oriented programming language

  3. An interactive website

  4. None of the above

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Java is a high-level, class-based, object-oriented programming language that follows the WORA (Write Once, Run Anywhere) principle. It uses objects and classes to structure code, supports inheritance, encapsulation, polymorphism, and abstraction as core OOP concepts.

Multiple choice technology web technology
  1. Java programming is derived from C++

  2. The Java Virtual Machine(JVM) interprets the program for the native operating system

  3. The compiler is identical to a C++ compiler

  4. The APIs do all the work

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Java achieves platform independence through the Java Virtual Machine (JVM), which interprets compiled bytecode for the specific host operating system. This 'Write Once, Run Anywhere' capability means the same compiled program can run on Windows, Linux, macOS, or any platform with a JVM without recompilation.

Multiple choice technology programming languages
  1. perl -c <<programname>>

  2. perl -c

  3. You cannot compile a program

  4. perl -e <<programname>>

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The -c flag in Perl performs a syntax check (compile) without actually executing the program. This is useful for catching errors before running code. Option B (-c without filename) is incomplete, and option D (-e) executes inline code, not compilation.

Multiple choice technology programming languages
  1. ASP.NET

  2. JAVA

  3. Visual C++

  4. COBOL

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Hibernate is an Object-Relational Mapping (ORM) framework for Java applications. It maps Java objects to database tables and handles data persistence. Hibernate is not used in ASP.NET (.NET), Visual C++, or COBOL - those platforms have their own ORM solutions like Entity Framework, native C++ libraries, or COBOL-specific database interfaces.

Multiple choice technology mainframe
  1. Job Controlling Language

  2. Job Controls Language

  3. Job Control Language

  4. Job Controller Language

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

JCL stands for Job Control Language, which is a scripting language used on IBM mainframe systems to define and execute jobs. The other options incorrectly use 'Controlling', 'Controls', or 'Controller' instead of 'Control'.

Multiple choice technology programming languages
  1. A type of coffee

  2. An object-oriented programming language

  3. A Structured Programming language

  4. An interactive website

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Java is a class-based, object-oriented programming language designed to have as few implementation dependencies as possible. Option A is a humorous reference to coffee, not technical fact. Option C is incorrect because Java is object-oriented, not procedural like C or Pascal. Option D describes web applications, not a programming language.

Multiple choice technology programming languages
  1. Java programming is derived from C++.

  2. The compiler is identical to a C++ compiler.

  3. The APIs do all the work.

  4. The Java Virtual Machine(JVM) interprets the program for the native operating system.

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Java achieves platform independence through the JVM, which interprets compiled bytecode for each specific operating system. This 'write once, run anywhere' capability is Java's hallmark. Option A is irrelevant - derivation from C++ doesn't enable cross-platform execution. Option B is false - Java compilers are distinct from C++ compilers. Option C overstates API capabilities.

Multiple choice technology programming languages
  1. Java programming is derived from C++.

  2. The Java Virtual Machine(JVM) interprets the program for the native operating system.

  3. The compiler is identical to a C++ compiler.

  4. The APIs do all the work.

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Java achieves platform independence through its 'write once, run anywhere' capability via the Java Virtual Machine (JVM). Java source code compiles to bytecode, which is then interpreted by the JVM specific to each operating system. The JVM acts as an intermediary, translating the bytecode into native machine instructions for the underlying platform. Option A incorrectly suggests C++ derivation, while option C is wrong because Java compilers are platform-specific, not identical to C++ compilers.

Multiple choice technology programming languages
  1. A type of coffee

  2. An object-oriented programming language

  3. A Structured Programming language

  4. An interactive website

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Java is an object-oriented programming language that supports classes, objects, inheritance, polymorphism, and encapsulation. It was designed to be simple, secure, and platform-independent. Unlike structured programming languages, Java organizes code around objects rather than functions and procedures.