Programming Languages Fundamentals Quiz

Covers basic knowledge of multiple programming languages (BASIC, FORTRAN, COBOL, LISP, C++, Java) including language expansions, data types, operators, and syntax comparisons

20 Questions Published

Questions

Question 1 True/False

Declarations must appear at the start of the body of a Java method.

  1. True
  2. False
Question 2 True/False

All bitwise operations are carried out with the same level of precedence in Java.

  1. True
  2. False
Question 3 True/False

The operations y >> 3 and y >>> 3 produce the same result when y > 0.

  1. True
  2. False
Question 4 Multiple Choice (Single Answer)

15 & 29 = ?

  1. 12
  2. 44
  3. 14
  4. 13
Question 5 Multiple Choice (Single Answer)

The type long in java can be used to store values in the following range:

  1. -231 to 231 - 1
  2. -232 to 232 - 1
  3. -264 to 264
  4. -263 to 263 - 1
Question 6 Multiple Choice (Single Answer)

What will be the result of the expression a % b when a and b are of type int and their values are a = 10 and b = 6?

  1. 1.66
  2. 4
  3. 1
  4. None of these
Question 7 Multiple Choice (Single Answer)

Identify the statements that are correct: (A) int a = 13, a>>2 = 3 (B) int b = -8, b>>1 = -4 (C) int a = 13, a>>>2 = 3 (D) int b = -8, b>>>1 = -4

  1. (A) & (B)
  2. (A), (B), (C) & (D)
  3. (A), (B) & (C)
  4. (C) & (D)
Question 8 Multiple Choice (Single Answer)

27 | 8 = ?

  1. 19
  2. 8
  3. 27
  4. 35
Question 9 Multiple Choice (Single Answer)

Consider the following code: int x, y, z; y = 1; z = 5; x = 0 - (++y) + z++; After execution of this, what will be the values of x, y and z?

  1. x = 4, y = 2, z = 6
  2. x = 3, y = 2, z = 6
  3. x = 4, y = 1, z = 5
  4. x = -7, y = 1, z = 5
Question 10 Multiple Choice (Single Answer)

What will be the result of the expression a % b when a and b are of type int and their values are a = -17 and b = -6?

  1. 5
  2. -5
  3. -23
  4. None of these
Question 11 Multiple Choice (Single Answer)

Which of the following is not a hexadecimal number? (A) 999 (B) (hex)23 (C) 0x556 (D) 0x1F2

  1. (A), (B) & (C)
  2. (A) & (B)
  3. (A)
  4. (C)
Question 12 Multiple Choice (Single Answer)

If not assigned a value, a variable of type char has the following default value:

  1. '\uffff'
  2. '\u0001'
  3. '\u0000'
  4. " " (space)
Question 13 Multiple Choice (Single Answer)

By which keyword Boolean data type is expressed in C++?

  1. boolean
  2. boo
  3. bolean
  4. bool
Question 14 True/False

Java supports preprocessor.

  1. True
  2. False
Question 15 True/False

C++ does not support string type.

  1. True
  2. False
Question 16 True/False

C++ requires that you re-declare static data members outside the class. This is not required in Java.

  1. True
  2. False
Question 17 Multiple Choice (Single Answer)

Expanstion of LISP ....

  1. List Programming
  2. LISt Programming
  3. List Instruction Set Programming
  4. List Information Set Programming
Question 18 Multiple Choice (Single Answer)

Expansion of COBOL ....

  1. Common Object Business Oriented Language
  2. Complete Object Business Oriented Language
  3. Common Object BASIC Oriented Language
  4. Common Oriented Business Object Language
Question 19 Multiple Choice (Single Answer)

Expansion of FORTRAN ....

  1. FORmula TRANslation
  2. FORmula TRANslator
  3. FORmal TRANslation
  4. FORmal TRANslator
Question 20 Multiple Choice (Single Answer)

Expansion of BASIC ......

  1. Begin All Program Symbolic Instruction Code
  2. Beginners' All-purpose Symbolic Information Code
  3. Beginners' All-purpose System Instruction Code
  4. Beginners' All-purpose Symbolic Instruction Code