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 technology databases
  1. Not Declared explicitly

  2. Raised implicitly when a predefined Oracle error occurs

  3. caught by referencing the standard name within an exception-handling routine

  4. All of the above

  5. None of the above

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

Named system exceptions in PL/SQL (like NO_DATA_FOUND, TOO_MANY_ROWS, DUP_VAL_ON_INDEX) are predefined exceptions that don't require explicit declaration, are raised automatically when specific Oracle errors occur, and are caught by referencing their standard names in exception handlers. These are built into the PL/SQL language for common error conditions.

Multiple choice technology databases
  1. DECLARE

  2. RAISE

  3. PRAGMA

  4. INITIATE

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

In PL/SQL, user-defined exceptions must be explicitly raised using the RAISE statement when the error condition occurs. Unlike predefined exceptions that are raised automatically by Oracle, your custom exceptions need manual triggering with RAISE exception_name;. This allows controlled error handling for application-specific conditions.

Multiple choice technology databases
  1. Hardware failures

  2. Design faults

  3. Coding mistakes

  4. None of the above

  5. All of the above

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

Run-time errors can originate from multiple sources including hardware failures (disk crashes, memory errors), design faults (logic errors, incorrect requirements interpretation), and coding mistakes (syntax errors, boundary violations). The most comprehensive answer recognizes that all these categories contribute to run-time error conditions.

Multiple choice technology databases
  1. True

  2. False

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

In PL/SQL, exceptions have scope similar to variables. You can declare an exception with the same name in two different blocks (nested or separate). The exception declared in the inner block will hide the one in the outer block, or they will simply exist independently in their respective scopes.

Multiple choice technology databases
  1. ISNULL(@variable,'5')

  2. NULLIF(@variable,'5')

  3. COALESCE(@variable,'5')

  4. NONNULL(@variable,'5')

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

ISNULL(@variable,'5') returns '5' when @variable is NULL, otherwise returns @variable itself. COALESCE(@variable,'5') does the same by returning the first non-NULL value from its arguments. NULLIF returns NULL if two values are equal - the opposite behavior needed here, and NONNULL is not a valid SQL function.

Multiple choice technology
  1. Events

  2. Value Set

  3. Lookup Type

  4. None of the Above

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

In Oracle Workflow, a Lookup Type defines a list of possible values that can be referenced by messages, notifications, functions, or processes as their potential result types. It acts as a constrained set of valid outcomes for workflow components. Value Sets are different (they define valid values for parameters), and Events are workflow occurrences, not result type lists.

Multiple choice technology operating systems
  1. /BEFORE

  2. /EXPRIED

  3. all of the above

  4. none of the above

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

This question tests knowledge of VMS APPEND command qualifier compatibility rules. In VMS, the /CREATED qualifier (used with /MODIFIED, /BEFORE, /AFTER) has specific incompatibility rules. The /CREATED qualifier is incompatible with time-based selection qualifiers when used in certain combinations, and the question is designed to test that specific knowledge.

Multiple choice technology mainframe
  1. STOP RUN is the last executable statement of the main program. It returns control back to OS.

  2. EXIT PROGRAM is the last executable statement of sub-program. It returns control back to main program.

  3. GOBACK can be coded in main program as well as sub-program as the last statement. It just gives the control back from where it received the control.

  4. None of the above.

Reveal answer Fill a bubble to check yourself
A,B,C Correct answer
Explanation

In COBOL, STOP RUN terminates the run unit and returns control to the OS. EXIT PROGRAM is used in a subprogram to return control to the calling program. GOBACK can be used in both and returns control to the caller. Thus, all three statements are correct.

Multiple choice technology mainframe
  1. JOB Statement

  2. EXEC Statement

  3. NONE

  4. Both JOB and EXEC statement

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

The COND parameter in JCL is used to test return codes from previous steps and control job/step execution based on those conditions. It can be specified on both JOB statements (to control execution of the entire job) and EXEC statements (to control individual job steps).

Multiple choice technology mainframe
  1. True

  2. False

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

COBOL was designed to be highly readable and English-like, using verbose syntax and descriptive names. This design philosophy makes COBOL programs self-documenting, meaning the code itself is easy to read and understand without extensive external documentation.