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
A
Correct answer
Explanation
The If keyword is a conditional statement that executes code based on whether a condition is true or false. For, Do, and While are loop constructs that repeat code blocks multiple times. Conditional statements control program flow based on conditions, while loops control iteration.
-
File
-
Unique
-
Random
-
Sequential
C,D
Correct answer
Explanation
In HP LoadRunner (or Micro Focus VuGen) Run Logic block properties, the block execution logic can be set to either 'Sequential' or 'Random' to control how the containing actions are called. 'File' and 'Unique' are parameter types, not block run logic settings.
-
If-then-else block
-
Switch block
-
While block
-
Any of the above
B
Correct answer
Explanation
Conditional branching in BPEL is implemented using the Switch activity, which evaluates multiple cases and executes the first one whose condition matches. This is similar to switch-case statements in programming languages. The if-then-else construct (option A) does not exist in standard BPEL, and while (option C) is used for looping, not conditional branching.
-
General: Log
-
General: Run Logic
-
General: Miscellaneous
-
. General: Additional Attributes
A
Correct answer
Explanation
In LoadRunner's runtime settings, the Log option (under General) allows you to configure logging levels including logging only when errors occur. This is a performance testing best practice to reduce log volume while capturing critical failure information. The other options (Run Logic, Miscellaneous, Additional Attributes) control different aspects of test execution but not error-specific logging behavior.
A
Correct answer
Explanation
In SQR programming, the DO command is used to invoke or call a procedure. This allows for modular code structure and reusability of code blocks.
D
Correct answer
Explanation
The MOVE command in SQR performs implicit datatype conversion when moving values between variables of different types. This allows automatic conversion between numeric, string, and date types.
-
Iteration
-
Recursion
-
Looping
-
Calling
B
Correct answer
Explanation
Recursion occurs when a function calls itself, either directly or indirectly. This is a fundamental programming technique for solving problems that can be broken down into similar sub-problems.
-
CALL STATEMENT
-
ADD STATEMENT
-
LEVEL NUMBERS
-
IF STATEMENT
C
Correct answer
Explanation
Easytrieve defines fields using flat starting positions and length attributes, completely omitting COBOL's structured level numbers (like 01, 05). It still retains logical constructs like IF, ADD, and CALL.
-
SELECT
-
CASE
-
ESTIMATE
-
SEARCH
B
Correct answer
Explanation
CASE is used in EasyTrieve instead of EVALUATE in COBOL for conditional branching based on multiple possible values. Both serve similar purposes - allowing different actions based on a variable's value - but CASE is the EasyTrieve keyword. SELECT is for file processing, ESTIMATE doesn't exist in EasyTrieve, and SEARCH is for table lookups.
-
TYPRUN=HOLD
-
TYPRUN=SCAN
-
TYPRUN=CHECK
-
TYPRUN
A
Correct answer
Explanation
TYPRUN=HOLD is the JCL parameter that specifically holds a job from execution until it is released by an operator. TYPRUN=SCAN checks for syntax errors without execution, TYPRUN=CHECK validates the job without running it, and TYPRUN alone is not a valid hold parameter.
-
echo
-
printf
-
print
-
display
C
Correct answer
Explanation
In PHP, 'print' is a language construct that behaves like a function but doesn't require parentheses. It always returns 1, making it usable in expressions. 'echo' is also a construct but cannot be used in expressions. 'printf' is a true function that requires parentheses.
-
$mprjet
-
$mpjret
-
$mejret
-
None of the above
B
Correct answer
Explanation
The $mpjret variable contains the return code or status of graph execution in Ab Initio. This variable is automatically set after graph completion and can be checked to determine if the graph succeeded or failed. The other variable names ($mprjet, $mejret) are not standard Ab Initio system variables.
-
Is_valid()
-
Is_null()
-
Is_blank()
-
Is_defined()
B,D
Correct answer
Explanation
Is_null() specifically checks for NULL values in Ab Initio. Is_defined() checks whether a value is defined (not NULL). Both are valid for NULL checking, though they work oppositely. Is_valid() validates data type/format, and Is_blank() checks for empty/blank strings.
-
ABLOCAL() function
-
AB_LOCAL()function
-
AB-LOCAL() function
-
AB_UNLOAD() function.
A
Correct answer
Explanation
ABLOCAL() allows Ab Initio to partition database unload operations, with each partition handling a subset of data. This enables parallel processing for faster data extraction. The function name must use an underscore (ABLOCAL not AB_LOCAL or AB-LOCAL).