Tag: programming languages

Questions Related to programming languages

  1. response.write("Hello World")

  2. document.write("Hello World")

  3. ("Hello World")

  4. "Hello World"


Correct Option: B
Explanation:

To write "Hello World" in JavaScript, the correct syntax is:

B. document.write("Hello World")

Explanation:

A. response.write("Hello World"): This is not the correct syntax. The "response" object does not have a "write" method in JavaScript.

B. document.write("Hello World"): This is the correct syntax. The "document" object represents the current web page, and the "write" method is used to write content directly to the web page. In this case, it will write "Hello World" to the page.

C. ("Hello World"): This is not the correct syntax. Parentheses alone do not have any specific meaning in JavaScript.

D. "Hello World": This is a string literal and is valid syntax in JavaScript. However, it does not actually write "Hello World" to the web page. It is just a static string value that can be assigned to a variable or used in other operations.

Therefore, the correct answer is B. document.write("Hello World").

  1. for (i = 0; i <= 5; i++)

  2. for i = 1 to 5

  3. for (i <= 5; i++)

  4. for (i = 0; i <= 5)


Correct Option: A
  1. SELECT * FROM Contest WHERE ContestDate < '05/25/2006'

  2. SELECT * FROM Contest HAVING ContestDate >= '05/25/2006'

  3. SELECT * FROM Contest WHERE ContestDate >= '05/25/2006'

  4. None of the above


Correct Option: C
  1. To retrieve data.

  2. To insert data.

  3. To modify data.

  4. All the above


Correct Option: B
  1. checks if the table has primary key specified

  2. deletes the table

  3. deletes all rows from a table

  4. None of the above


Correct Option: C