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 programming languages
  1. True

  2. False

  3. Cannot continuously increment a variable

  4. It depends on the variable type

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

Integer overflow behavior depends on the data type. Signed integers wrap around and become negative when incremented beyond their maximum value (e.g., 127+1=-128 for byte). Unsigned integers wrap to zero. The question tests understanding of type-specific overflow behavior.

Multiple choice technology platforms and products
  1. thread

  2. node

  3. both a and b

  4. none of the above

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

In Ab Initio, declare pages can be of both thread and node types. This flexibility allows declare pages to be used in different parallel processing contexts - thread-level for shared memory operations and node-level for distributed processing across partitions.

Multiple choice technology databases
  1. E

  2. I

  3. F

  4. C

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

In RPG/400 programming, arrays are declared in the E-spec (Extension specification). The E-spec is specifically designed for defining array characteristics including dimensions, and element sizes. Other specs like I (Input), F (File), or C (Calculation) serve different purposes.

Multiple choice technology databases
  1. SETLL

  2. SETGT

  3. Both 1 & 2

  4. Neither 1 nor 2

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

Both SETLL (Set Lower Limit) and SETGT (Set Greater Than) are positioning operations in RPG/400 that act as pointers to specific records in a file. SETLL positions at the first record greater than or equal to a key, while SETGT positions at the first record greater than a key. Both are pointer operations used for record positioning.

Multiple choice technology databases
  1. SETLL + READP

  2. SETGT + READP

  3. SETLL + READE

  4. SETGT + READE

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

In RPG, the CHAIN operation combines the positioning and reading capabilities of SETLL (Set Lower Limit) to locate a record and READE (Read Equal Key) to retrieve it. Options using READP are wrong because they read prior records rather than matching keys.

Multiple choice technology programming languages
  1. True

  2. False

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

In C function parameter declarations, array notation always decays to a pointer. When you write 'int a[5]' as a function parameter, it is automatically converted to 'int *a' by the compiler. The array size (5 in this case) is ignored - the compiler only cares that it's a pointer to an integer. This is why array parameters don't carry size information.

Multiple choice technology databases
  1. Raise Application procedure

  2. Raise Application Error procedure

  3. Application Error procedure

  4. None of the Above

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

In PL/SQL, RAISE_APPLICATION_ERROR (represented here as Raise Application Error) is the standard built-in procedure used to issue user-defined error messages from stored subprograms. The other options are incorrect or generic names that do not exist as built-in PL/SQL procedures for this purpose.

Multiple choice technology databases
  1. True

  2. False

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

In PL/SQL, a function must return exactly one value, not zero or more. A procedure does not return a value to its calling environment (it can have OUT parameters, but that's different from a return value). The statement reverses the correct definitions, making it false.

Multiple choice technology databases
  1. The package itself cannot be called, parameterized, or nested.

  2. The format of a package is similar to that of a subprogram.

  3. The contents can be shared by many applications once written.

  4. None of the above.

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

Option A is correct: packages cannot be called or nested like subprograms. Option B is correct: packages have a two-part format (specification and body) similar to subprograms. Option C is correct: packages are designed for code reuse across applications. Since all statements A-C are true, 'None of the above' is the false statement.

Multiple choice technology programming languages
  1. A loop that functions infinitely well

  2. A loop that runs forever

  3. A loop that never starts

  4. A loop that will never function

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

An infinite loop is a loop that executes indefinitely without terminating. Option B correctly defines this. Option A describes a well-functioning loop (not necessarily infinite). Option C describes a loop that never starts (not infinite). Option D describes a non-functional loop (different concept).