Computer Knowledge

Programming Fundamentals

2,381 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 programming languages
  1. var

  2. type

  3. typeof

  4. null

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

The var keyword in C# enables implicitly typed local variables, where the compiler determines the variable's type from the initialization expression. This is not dynamic typing - the type is fixed at compile-time based on what's assigned. The var keyword makes code more readable when the type is obvious from the initialization. Other options like typeof, type, and null don't provide this compiler inference capability.

Multiple choice technology programming languages
  1. override

  2. volatile

  3. unsafe

  4. virtual

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

In C#, the 'volatile' keyword indicates that a field can be modified by external factors such as the operating system, hardware, or concurrently executing threads. This prevents compiler optimizations that might assume the field's value doesn't change outside the current thread.

Multiple choice technology databases
  1. True

  2. False

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

Compilers generate low-level instructions (machine code or intermediate code) that are executed by the CPU or a runtime environment like JVM. DDL (Data Definition Language) interpreters are database tools that process schema definitions like CREATE TABLE commands - they don't execute compiled code.

Multiple choice technology mainframe
  1. True

  2. False

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

The PROCEDURE instruction in REXX creates a new variable scope, making all variables in the function/subroutine local by default. This means variables inside the procedure don't affect variables with the same name in the calling program unless explicitly exposed using the EXPOSE instruction.

Multiple choice technology mainframe
  1. Allow Variable-1 through variable-n to be shared with the main part of the program

  2. Used with the PROCEDURE instruction

  3. suppress Variable-1 through variable-n not to be share with main part of the program

  4. All the above

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

EXPOSE is used with PROCEDURE to selectively allow specific variables to be shared between the main program and the procedure, overriding the default local scope. Options A and B are correct: EXPOSE allows variables A through n to be shared, and it is used with PROCEDURE instruction. Option C is incorrect as EXPOSE enables sharing, doesn't suppress it.

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.

Multiple choice technology mainframe
  1. Names must be 10 or less characters.

  2. Names must contain at least 1 alpha character in any position.

  3. Names must be lower case.

  4. Multiple word names must be separated with an underscore.

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

COBOL requires user-defined names to contain at least one alphabetic character. Names can be 1-30 characters, can be mixed case, and hyphens (not underscores) are used in multi-word names. Numeric characters are allowed but not required.