Computer Knowledge

Programming Fundamentals

2,611 Questions

Programming fundamentals form the core logic of software development and computer science. This includes variable declarations, pointer assignments, loop iterations, and exception handling. These technical topics are regularly tested in computer knowledge and IT officer competitive examinations.

Variables and arraysPointer assignmentsLoop iterationsException handling blocksCompile time errorsFunction references

Programming Fundamentals Questions

Multiple choice
  1. The element number in array plays a major role in calling each element of the array.

  2. Execution time with a pointer is little slow.

  3. An external variable is declared outside the body of a function.

  4. Both 1 and 3.

  5. None of these

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

This option is true.

Multiple choice
  1. The element number in array plays a major role in calling each element of array.

  2. The execution time with pointer is slower.

  3. An external variable is declared outside the body of a function.

  4. Both 2 and 3

  5. None of these

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

The execution time with pointers is very fast.

Multiple choice
  1. goes out of scope

  2. expires

  3. both (1) and (2)

  4. none of the above

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

The destructor is automatically called when an object either goes out of scope or reaches the end of its lifetime (expires). Both scenarios trigger the destructor to clean up resources.

Multiple choice
  1. +=

  2. =

  3. = =

  4. All of the above

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

In C++, the +=, =, and == operators can all be overloaded. The += operator can be overloaded as a compound assignment operator, while = and == can be overloaded as member or non-member functions.

Multiple choice
  1. data is secure

  2. data is insecure

  3. data is abstract

  4. none of the above

Reveal answer Fill a bubble to check yourself
B Correct answer