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. a program

  2. an object deck

  3. an execution

  4. a single-line

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

In a standard two-pass assembler, the first pass is dedicated to scanning the source code to identify symbols and build a symbol table. The second pass uses the addresses determined in the first pass to translate the assembly code into machine code. The resulting output is known as an object deck or object module, which is ready for the loader.

Multiple choice
  1. It is used to store a direct pointer to the new value, but call release on the old value and retain on the new one.

  2. It uses a direct pointer to the new value.

  3. It increases the retain count of an object by 1.

  4. It decreases the retain count of an object by 1.

  5. It makes a copy of an object and returns it with retain count of 1.

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

Assign is used to set a property's pointer to the address of the object without retaining it or otherwise curating it.

Multiple choice
  1. These exceptions are raised implicitly.

  2. These exceptions can be handled explicitly also.

  3. These are pre-defined exceptions and given a name in Oracle.

  4. EXCEPTION_INIT has associate a predefined Oracle error number to a programmer_defined exception name.

  5. The pragma EXCEPTION_INIT is declared in the declarative part of a PL/SQL block.

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

These are not the exceptions that occur frequently. So, these are not predefined and cannot be given a name in Oracle.

Multiple choice
  1. An user-defined exception must be declared and then raised explicitly.

  2. An user defined exception can be created using a RAISE statement.

  3. The procedure DBMS_STANDARD. RAISE_APPLICATION_ERROR can also throw an user defined exception.

  4. RAISE statements can raise predefined exceptions and also user defined exceptions.

  5. User-defined exceptions are declared in the exception section with their types as exceptions.

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

This is false as user defined exceptions are declared in the declaration section with their types as exception.

Multiple choice
  1. These exceptions are internally defined exceptions with a name.

  2. These exceptions are raised by the system.

  3. The storage error is a predefined exception.

  4. Out of memory is a predefined exception.

  5. ZERO_DIVIDE is an example of predefined exception.

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

This is an internally defined exception and not a predefined exception.

Multiple choice
  1. By avoiding goto statements

  2. By using meaningful and indicative names of variables and functions

  3. By using modular programming

  4. All of the above

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

Readability is improved by using clear naming conventions, avoiding complex control flow like goto, and utilizing modular programming to break code into manageable pieces.