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
-
DFHEIBDK, DFHCOMMAREA
-
DFHEIBLK, DFHCOMNAREA
-
DFHEEBLK, DFHCOMMAREA
-
DFHEIBLK, DFHCOMMAREA
D
Correct answer
Explanation
When a CICS program is compiled, the preprocessor includes DFHEIBLK (the CICS Execute Interface Block) and DFHCOMMAREA (the communication area definition) to provide the necessary CICS interface structures. Options A, B, and C have typos in the field names (DFHEIBDK, DFHCOMNAREA, DFHEEBLK).
-
Type N
-
Type C
-
Type F
-
Type P
C
Correct answer
Explanation
This appears to be a SAP ABAP question. In ABAP, Type F (floating-point) cannot be used to define parameters - it's not allowed for parameter definitions due to precision and rounding issues. Types N (numeric text), C (character), and P (packed number) are valid parameter types.
A
Correct answer
Explanation
In Java, StringBuffer and StringBuilder objects are mutable, meaning their contents can be modified after creation without creating new objects. This is in contrast to the String class, which is immutable.
E
Correct answer
Explanation
The CNTL statement in JCL marks the beginning of one or more program control statements that are passed to the program being executed. It's used to pass control information to the program.
-
Positional, Keyword
-
Keyword, Control
-
Dynamic, Static
-
Named, Dynamic
-
None of the above
A
Correct answer
Explanation
DD (Data Definition) statements in JCL have two parameter types: positional parameters (which must appear in a specific order, like dataset name) and keyword parameters (identified by keywords like DISP, SPACE, UNIT, etc., which can appear in any order). Positional parameters come first, followed by keyword parameters.
B
Correct answer
Explanation
TYPRUN=SCAN performs syntax checking without execution, TYPRUN=COPY copies the job to the reader, and TYPRUN=HOLD holds the job. RUN is not a valid TYPRUN value to execute a job normally you omit the TYPRUN parameter entirely.
-
PARM
-
PERFORM
-
TIME
-
ADDRSPC
-
None
-
Unmatched bracket in for statement
-
Flush attribute must be false
-
Keyword 'file' should be used instead of 'page' in the <jsp:forward/> action
-
Actions cannot be used within scriptlet blocks
D
Correct answer
Explanation
JSP actions (like ) are XML-based tags and cannot be embedded within scriptlet blocks (<% %>). Scriptlets contain Java code, while actions are processed by the JSP container at a different phase. To use actions conditionally, you would need to structure the code differently or use scriptlets exclusively.
-
sendevent -E DELETE_GLOBAL -G "today=DELETE"
-
sendevent -E SET_GLOBAL -G "today=NULL"
-
sendevent -E SET_GLOBAL -G "today=DELETE"
-
sendevent -DELETE "today"
C
Correct answer
Explanation
To delete a global variable in AutoSys, use sendevent -E SET_GLOBAL with the variable name set to DELETE. Option A incorrectly uses DELETE_GLOBAL which is not a valid event. Option B sets the variable to NULL rather than deleting it. Option D has invalid syntax.
-
TYPRUN=COMPILE
-
TYPRUN=ERRFREE
-
TYPRUN=HOLD
-
TYPRUN=SCAN
D
Correct answer
Explanation
TYPRUN=SCAN performs only syntax checking without code generation or execution, making it ideal for error-only verification. ERRFREE checks for errors but suppresses valid messages. COMPILE generates object code. HOLD defers compilation.
-
Step will not execute
-
Step will abend
-
Step will execute
-
S0C7
A
Correct answer
Explanation
In JCL, the COND parameter specifies a condition that, if true, causes the step to be bypassed (not executed). This allows conditional execution based on return codes from previous steps. Option B (abend) would mean abnormal termination, not skipping. Option C (execute) is the opposite of what COND does. S0C7 (option D) is a specific system abend code for data exception, unrelated to COND logic.
-
EXEC
-
SYSABEND
-
JOBLIB
-
SYSPRINT
C
Correct answer
Explanation
JOBLIB is a JCL statement (not a keyword on EXEC) that must appear before the first EXEC statement in a job. The keywords EXEC, SYSABEND, and SYSPRINT can all be used on PROC EXEC statements. JOBLIB is used at the job level, not within a PROC.
B
Correct answer
Explanation
PARM is the JCL keyword used to pass input data to a program (typically through the EXEC PARM parameter). INPUT is not a JCL keyword. SYSOUT is for output classification. COND is for conditional execution.
-
while until
-
until, while
-
repeat, while
-
None
A
Correct answer
Explanation
The while loop continues executing as long as its condition returns exit status 0 (true), whereas the until loop executes until its condition becomes 0 (true), meaning it runs while the condition returns non-zero (false). This is the inverse behavior.
-
function_name() {command-list }
-
function_name ( ) { }
-
function name (command list ) {
-
None
A
Correct answer
Explanation
The correct bash function syntax is function_name() { commands; }. Option B has a space before () which is invalid. Option C has incorrect syntax with parentheses around function name and missing braces. Option D is incorrect as option A is valid.