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
-
Step will not execute
-
Step will abend
-
Step will execute
-
S0C7
-
EXEC
-
SYSABEND
-
JOBLIB
-
SYSPRINT
C
Correct answer
Explanation
JOBLIB is a job-level statement that defines a private library for the entire job and cannot appear within a PROC. PROCs can contain EXEC statements (for steps), DD statements (like SYSPRINT for output, SYSABEND forabend dumps), and other step-level elements. JOBLIB must precede the first EXEC statement in a job.
-
TYPRUN=COMPILE
-
TYPRUN=ERRFREE
-
TYPRUN=HOLD
-
TYPRUN=SCAN
D
Correct answer
Explanation
TYPRUN=SCAN performs syntax checking without executing the job, useful for validating JCL before production submission. COMPILE compiles and executes the program. HOLD holds the job in the input queue without execution. ERRFREE is not a valid TYPRUN parameter value.
B
Correct answer
Explanation
PARM is the JCL parameter used to pass input values to a COBOL (or other) program at execution time. INPUT is not a JCL parameter, SYSOUT defines output class, and COND specifies step conditional execution.
-
open cursor; ---some statements close;
-
open cursor; fetch into variables; ---some statements close cursor;
-
open cursor; fetch into variables; ---some statements close;
-
All of the above
B
Correct answer
Explanation
The correct structure of an explicit cursor is: OPEN cursor, FETCH cursor INTO variables, process the data, then CLOSE cursor. Option B correctly shows this complete lifecycle with FETCH statement included.
-
NUMBER
-
BOOLEAN
-
CHARACTER
-
STRING
B
Correct answer
Explanation
The %FOUND cursor attribute returns a BOOLEAN value (TRUE if a row was fetched, FALSE if not). It does not return NUMBER, CHARACTER, or STRING types.
A
Correct answer
Explanation
The default parameter mode for procedures is IN. IN parameters pass values into the procedure but cannot be modified within the procedure.
-
IN
-
IN, OUT
-
IN, OUT,INOUT
-
IN, OUT, INOUT , OUTIN
C
Correct answer
Explanation
Procedures accept three parameter modes: IN (read-only input), OUT (write-only output), and INOUT (read and write). These modes control how data flows between the procedure and calling environment.
-
A. ByVal
-
B. ByRef
-
C. ByArg
-
D. ByRes
B
Correct answer
Explanation
Quick Test Professional (QTP) passes arguments to procedures by reference (ByRef) by default, meaning the procedure receives a reference to the original variable. This allows the procedure to modify the original variable's value, which is efficient for memory usage but requires awareness of potential side effects.
-
DFHEIBDK, DFHCOMMAREA
-
DFHEIBLK, DFHCOMNAREA
-
DFHEEBLK, DFHCOMMAREA
-
DFHEIBLK, DFHCOMMAREA
D
Correct answer
Explanation
The CICS translator inserts the EXEC Interface Block (DFHEIBLK) and the Communication Area (DFHCOMMAREA) into the Linkage Section of a COBOL program to handle CICS system communication and data passing.
-
double
-
Switch
-
then
-
instanceof
A,D
Correct answer
Explanation
double and instanceof are valid Java keywords. Switch is incorrect (must be lowercase 'switch'). 'then' is not a Java keyword (it's used in some other languages but not Java).
-
It offers option of sharing local variables and better run time efficiency
-
Provides benefit of automatic recompilation
-
It is processed during translation and compilation and does not impose any restrictions on output buffering
-
none of the above
A
Correct answer
Explanation
The JSP include directive (<%@ include file="..." %>) merges the content of the target file into the calling page during translation. This allows sharing of local variables and offers better runtime efficiency compared to dynamic inclusion.
A
Correct answer
Explanation
The System.arraycopy() method in Java is a native method used to efficiently copy data from a source array to a destination array.
-
return
-
break
-
goto
-
continue
C
Correct answer
Explanation
Java has 'goto' as a reserved keyword but it is not implemented as a branching statement - it has no functionality. 'return', 'break', and 'continue' are all valid branching statements that control flow. The question asks which is NOT a branching statement, making 'goto' (option C) the correct answer despite being syntactically reserved but unusable.
C
Correct answer
Explanation
In REXX, when a subroutine completes execution and returns a value using the RETURN instruction, that value is automatically stored in the special variable named RESULT.