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 testing
  1. While … Wend

  2. Do While … Loop

  3. Do Until … Loop

  4. VB Script doesn't have any deprecated loops at all.

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

In VBScript, While ... Wend is considered obsolete and deprecated in favor of the more flexible Do ... Loop structures. The language reference recommends avoiding While ... Wend in modern scripts.

Multiple choice technology programming languages
  1. True

  2. False

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

GETCURSOR is a statement in SAP ABAP used to capture the field value and position when a user double-clicks on a field in a list (ALV or basic list). It stores the field name, value, and line number, allowing the program to trace which specific data element was interacted with. This is commonly used for drill-down functionality and interactive reporting.

Multiple choice technology programming languages
  1. True

  2. False

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

In ABAP, internal tables passed using the TABLES parameter are passed by reference (address), not by value and result. The TABLES keyword creates a reference to the original internal table, so any changes made within the subroutine directly affect the calling program's table. Value and result would mean copying the entire table structure on both entry and exit, which would be inefficient for large internal tables.

Multiple choice technology databases
  1. CASE

  2. ISNULL

  3. ISNUMERIC

  4. ISDATE

  5. None

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

A deterministic function always returns the same result for the same input. Non-deterministic functions can return different results. ISDATE is non-deterministic because its behavior depends on session settings like DATEFORMAT and LANGUAGE - the same string might be interpreted differently. CASE, ISNULL, and ISNUMERIC are deterministic functions.

Multiple choice technology platforms and products
  1. Evaluate variable

  2. refresh variable

  3. set variable

  4. all the above

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

In programming and scripting environments, conditions are typically evaluated using an "evaluate variable" or similar conditional evaluation mechanism. The other options like 'set variable' (assignment) and 'refresh variable' (updating value) are not primarily used for condition checking. Option D 'all the above' would be incorrect since not all listed operations are used for checking conditions.

Multiple choice technology mainframe
  1. The control will come back to Program A

  2. The control will not come back to Program A and program B will terminate at the end of the STOP RUN statement

  3. Program B abends Abnormally

  4. Infinite loop

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

In COBOL, the STOP RUN statement terminates the entire run unit, not just the current program. When Program B (called program) executes STOP RUN, it immediately ends program execution and control does NOT return to Program A (the calling program). This is different from GOBACK or EXIT PROGRAM which would return control to the caller.

Multiple choice technology mainframe
  1. Perform Para-1

  2. Perform Para-1 Thru Para-2

  3. Perform Section-2 Section

  4. Perform Para-1 20 times

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

In COBOL, you perform paragraphs or sections. 'Perform Section-2 Section' is invalid syntax because appending the word 'Section' after the name in a PERFORM statement is incorrect. The other statements are valid standard COBOL syntax formats.

Multiple choice technology mainframe
  1. Infinite loop

  2. Logical Error

  3. Runtime Error

  4. All the above

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

COBOL IF statements can generate multiple error types: infinite loops from poorly designed conditions, logical errors from incorrect condition logic, and runtime errors from data type mismatches or boundary violations. All three error categories are possible in IF statement implementations.

Multiple choice technology mainframe
  1. Scans JCL for errors

  2. Invalid Syntax

  3. Scans for previous executing jobs

  4. Does nothing

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

SCAN is a JCL (Job Control Language) statement that performs syntax checking on the JCL itself. It scans for errors without executing the job, helping catch issues before actual processing. The other options are incorrect - SCAN is not for previous jobs, syntax errors, or doing nothing.