MCQs: Computer Programing Languages (1): HTML, JAVA, PHP: Computer MCQs

Computer Programing Languages

1: Which of the following programming languages is used for creating dynamic web pages?

A) C++

B) Java

C) Python

D) PHP

Answer: D

2: Which of the following programming languages is used for creating mobile apps?

A) C

B) Swift

C) Ruby

D) COBOL

Answer: B

3: Which of the following programming languages is used for data analysis and statistical computing?

A) Python

B) C#

C) Pascal

D) Fortran

Answer: A

4: Which of the following programming languages is used for game development?

A) HTML

B) Lua

C) Perl

D) Lisp

Answer: B

5: Which of the following programming languages is used for artificial intelligence and machine learning?

A) JavaScript

B) PHP

C) R

D) Ada

Answer: C

6: Which of the following programming languages is used for scientific computing and numerical analysis?

A) MATLAB

B) SQL

C) Visual Basic

D) Swift

Answer: A

7: Which of the following programming languages is used for building desktop applications?

A) Ruby

B) Python

C) Visual Basic

D) COBOL

Answer: C

8: Which of the following programming languages is used for system administration and automation?

A) Bash

B) Pascal

C) Delphi

D) Ada

Answer: A

9: Which of the following programming languages is used for web development and server-side scripting?

A) CSS

B) HTML

C) Ruby

D) Node.js

Answer: D

10: Which of the following programming languages is used for creating operating systems?

A) C

B) PHP

C) Python

D) Lisp

Answer: A

11: Which of the following programming languages is used for game development and virtual reality?

A) Unity

B) Perl

C) COBOL

D) Fortran

Answer: A

12: Which of the following programming languages is used for building blockchain applications?

A) Solidity

B) Visual Basic

C) Delphi

D) Pascal

Answer: A

13: Which of the following programming languages is used for building data-driven websites and web applications?

A) Python

B) Ruby on Rails

C) C++

D) Swift

Answer: B

14: Which of the following programming languages is used for creating computer graphics and visual effects?

A) Python

B) Java

C) C#

D) OpenGL

Answer: D

15: Which of the following programming languages is used for scientific computing and data analysis in the financial industry?

A) COBOL

B) R

C) Lua

D) Lisp

Answer: B

16: Which of the following programming languages is used for building machine learning models?

A) Java

B) Python

C) C++

D) Ruby

Answer: B

17: Which of the following programming languages is used for creating chatbots and conversational interfaces?

A) PHP

B) Python

C) Pascal

D) COBOL

Answer: B

18: Which of the following programming languages is used for building cross-platform mobile apps?

A) Objective-C

B) Swift

C) React Native

D) COBOL

Answer: C

19: Which of the following programming languages is used for building desktop applications on macOS and iOS?

A) Objective-C

B) Ruby

C) Java

D) Fortran

Answer: A

20: Which of the following programming languages is used for building web applications with real-time features?

A) PHP

B) Node.js

C) Ruby on Rails

D) Swift

Answer……

21: Which of the following programming languages is used for building web applications with a dynamic user interface?

A) Java

B) Python

C) JavaScript

D) COBOL

Answer: C

22: Which of the following programming languages is used for building mobile apps with cross-platform compatibility?

A) Java

B) C#

C) Xamarin

D) Perl

Answer: C

23: Which of the following programming languages is used for building web applications with a focus on security?

A) Ruby

B) PHP

C) Python

D) Go

Answer: D

24: Which of the following programming languages is used for building embedded systems and IoT devices?

A) C

B) Java

C) Lua

D) Visual Basic

Answer: A

25: Which of the following programming languages is used for building web applications with a focus on scalability and performance?

A) Python

B) Ruby on Rails

C) Node.js

D) COBOL

Answer: C

26: Which of the following programming languages is used for building desktop applications with a graphical user interface?

A) C#

B) Swift

C) Python

D) Lisp

Answer: A

27: Which of the following programming languages is used for building mobile apps with a focus on gaming?

A) Lua

B) C++

C) Ruby

D) Visual Basic

Answer: A

28: Which of the following programming languages is used for building web applications with a focus on real-time collaboration?

A) Ruby on Rails

B) Node.js

C) Meteor

D) Perl

Answer: C

29: Which of the following programming languages is used for building virtual reality and augmented reality applications?

A) C#

B) Python

C) Ruby

D) Lisp

Answer: A

30: Which of the following programming languages is used for building web applications with a focus on simplicity and ease of use?

A) PHP

B) Ruby on Rails

C) Flask

D) COBOL

Answer: B

HTML

1: What does HTML stand for?

A) Hyper Text Markup Language

B) High-level Text Management Language

C) Hyperspace Text Machine Learning

D) Hyper Terminal Management Language

Answer: A

2: Which of the following is a commonly used HTML tag for creating headings?

A) <head>

B) <title>

C) <h1>

D) <p>

Answer: C

3: Which of the following is a commonly used HTML tag for creating paragraphs?

A) <p>

B) <head>

C) <body>

D) <title>

Answer: A

4: Which of the following is a commonly used HTML tag for creating links?

A) <a>

B) <img>

C) <div>

D) <span>

Answer: A

5: Which of the following is a commonly used HTML tag for creating images?

A) <a>

B) <img>

C) <div>

D) <span>

Answer: B

6: Which of the following is a commonly used HTML tag for creating lists?

A) <ul>

B) <li>

C) <ol>

D) All of the above

Answer: D

7: Which of the following is a commonly used HTML tag for creating a line break?

A) <br>

B) <hr>

C) <p>

D) <span>

Answer: A

8: Which of the following is a commonly used HTML tag for creating a table?

A) <table>

B) <tr>

C) <td>

D) All of the above

Answer: D

9: Which of the following is a commonly used HTML tag for creating a form?

A) <form>

B) <input>

C) <select>

D) All of the above

Answer: D

10: Which of the following is a commonly used HTML tag for creating input fields?

A) <form>

B) <input>

C) <select>

D) <textarea>

Answer: B

11: Which of the following is a commonly used HTML tag for creating drop-down menus?

A) <form>

B) <input>

C) <select>

D) <textarea>

Answer: C

12: Which of the following is a commonly used HTML tag for creating a checkbox?

A) <input type=”text”>

B) <input type=”checkbox”>

C) <input type=”radio”>

D) <input type=”password”>

Answer: B

13: Which of the following is a commonly used HTML tag for creating a radio button?

A) <input type=”text”>

B) <input type=”checkbox”>

C) <input type=”radio”>

D) <input type=”password”>

Answer: C

14: Which of the following is a commonly used HTML tag for creating a button?

A) <button>

B) <input type=”button”>

C) <input type=”submit”>

D) All of the above

Answer: D

15: Which of the following is a commonly used HTML tag for creating a video?

A) <audio>

B) <video>

C) <img>

D) <iframe>

Answer: B

16: Which of the following is a commonly used HTML tag for creating an audio file?

A) <audio>

B) <video>

C) <img>

D) <iframe>

Answer: A

JAVA

1: What is the purpose of the “public static void main” method in Java?

A) To output data to the console

B) To input data from the console

C) To create a new object

D) To start the program execution

Answer: D

2: What is the difference between a class and an object in Java?

A) There is no difference

B) A class is a blueprint for creating objects, while an object is an instance of a class

C) A class is an instance of an object, while an object is a blueprint for creating classes

D) Both a class and an object are the same thing in Java

Answer: B

3: What is the syntax for declaring a variable in Java?

A) type varName;

B) varName = value;

C) varName = type;

D) type = varName;

Answer: A

4: Which of the following is NOT a primitive data type in Java?

A) int

B) float

C) double

D) string

Answer: D

5: Which of the following is NOT a type of loop in Java?

A) for loop

B) while loop

C) do-while loop

D) foreach loop

Answer: D

6: What is the purpose of the “Scanner” class in Java?

A) To output data to the console

B) To input data from the console

C) To create a new object

D) To perform a mathematical calculation

Answer: B

7: Which of the following is NOT a comparison operator in Java?

A) <

B) >

C) <=

D) <>

Answer: D

8: What is the purpose of the “if” statement in Java?

A) To declare a new variable

B) To loop through a block of code

C) To conditionally execute a block of code

D) To perform a mathematical calculation

Answer: C

9: What is the purpose of the “else” statement in Java?

A) To execute a block of code if a condition is true

B) To execute a block of code if a condition is false

C) To declare a new variable

D) To loop through a block of code

Answer: B

10: Which of the following is NOT a logical operator in Java?

A) &&

B) ||

C) !

D) &

Answer: D

11: What is the purpose of the “switch” statement in Java?

A) To execute a block of code if a condition is true

B) To execute a block of code if a condition is false

C) To conditionally execute a block of code based on the value of a variable

D) To declare a new variable

Answer: C

12: What is the purpose of the “break” keyword in Java?

A) To exit a loop or switch statement

B) To execute a block of code

C) To conditionally execute a block of code

D) To declare a new variable

Answer: A

13: What is the purpose of the “continue” keyword in Java?

A) To exit a loop or switch statement

B) To skip the current iteration of a loop

C) To conditionally execute a block of code

D) To declare a new variable

Answer: B

14: What is the purpose of the “new” keyword in Java?

A) To declare a new variable

B) To create a new object

C) To conditionally execute a block of code

D) To exit a loop or switch statement

Answer: B

PHP

1: What does PHP stand for?

A) Personal Home Page

B) Personal Hypertext Processor

C) PHP Hypertext Processor

D) PHP Hyperlink Processor

Answer: A

2: Which of the following is NOT a scalar data type in PHP?

A) Integer

B) String

C) Boolean

D) Array

Answer: D

3: What is the purpose of the “echo” statement in PHP?

A) To display output to the browser

B) To define a new function

C) To declare a new variable

D) To conditionally execute a block of code

Answer: A

4: What is the purpose of the “if” statement in PHP?

A) To declare a new variable

B) To conditionally execute a block of code

C) To loop through a block of code

D) To exit a loop or switch statement

Answer: B

5: Which of the following is the correct syntax for declaring a variable in PHP?

A) $variableName = value;

B) value = $variableName;

C) variableName = $value;

D) value = variableName;

Answer: A

6: What is the purpose of the “for” loop in PHP?

A) To conditionally execute a block of code

B) To loop through a block of code

C) To exit a loop or switch statement

D) To declare a new variable

Answer: B

7: Which of the following is the correct syntax for a “foreach” loop in PHP?

A) foreach($array as $value)

B) foreach($value as $array)

C) for($array as $value)

D) for($value as $array)

Answer: A

8: What is the purpose of the “switch” statement in PHP?

A) To execute a block of code if a condition is true

B) To execute a block of code if a condition is false

C) To conditionally execute a block of code based on the value of a variable

D) To declare a new variable

Answer: C

9: Which of the following is the correct syntax for defining a function in PHP?

A) function functionName()

B) functionName()

C) def functionName()

D) function functionName(parameters)

Answer: D

10: What is the purpose of the “return” keyword in PHP?

A) To declare a new variable

B) To exit a loop or switch statement

C) To return a value from a function

D) To display output to the browser

Answer: C

11: Which of the following is the correct syntax for passing parameters to a function in PHP?

A) functionName(parameter1, parameter2)

B) parameter1, parameter2 = functionName()

C) functionName() = parameter1, parameter2

D) functionName() -> parameter1, parameter2

Answer: A

12: What is the purpose of the “include” statement in PHP?

A) To include a file in the current script

B) To execute a block of code if a condition is true

C) To loop through a block of code

D) To declare a new variable

Answer: A

13: Which of the following is the correct syntax for a “while” loop in PHP?

A) while(condition)

B) while(condition) do

C) do while(condition)

D) do while(condition) loop

Answer: A

14: What is the purpose of the “try-catch” statement in PHP?

A) To handle exceptions in code

B) To conditionally execute a block of code

C) To loop through a block of code

D) To declare a new variable

Answer: A

Exit mobile version