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
-
SSRANGE
-
NOSSRANGE
-
RANGE
-
None of the above
B
Correct answer
Explanation
In IBM Enterprise COBOL, the default option for subscript and index range checking is NOSSRANGE. When NOSSRANGE is active, the compiler does not generate code to verify if subscripts or indexes are within the defined bounds of the table, whereas SSRANGE enables this overhead-inducing check.
-
end-evaluate
-
exit
-
continue
-
None of the above
A
Correct answer
Explanation
END-EVALUATE is a scope terminator that explicitly marks the end of an EVALUATE statement block in COBOL. Scope terminators like END-IF, END-PERFORM, and END-EVALUATE improve code readability and prevent ambiguity. EXIT is a statement that exits a program or paragraph, while CONTINUE is a no-op statement.
-
We can assign the object to a variable
-
We can use With and End with statements
-
We should use them every time
-
None of the above
A,B
Correct answer
Explanation
To optimize performance and code readability when a programmatic description is reused, we can assign the description to an object variable or group the statements using a With/End With block. Both options are valid, but as this is a multiple-choice question with multiple 'correct' options, it is marked as ok.
-
Dynamic
-
Tertiary
-
Static
-
Both 1 and 3
A
Correct answer
Explanation
Instantiating a description object using Set Myvar = Description.Create() and adding properties programmatically at runtime is known as dynamic descriptive programming. Static descriptive programming involves writing the property-value pairs directly in the statement inline.
-
A For Each…Next loop.
-
A Do...Loop.
-
A Loop-dee-Loop.
-
None of the above
B
Correct answer
Explanation
When you need to loop until finding a specified value, a Do...Loop is the appropriate choice. It allows you to continue iterating until a condition (like finding a target value) is met, using either Do Until value_found or Do While Not value_found. For Each...Next loops are designed for iterating through collections/arrays where you visit every element, not for stopping at a specific match. Option C is a nonsensical distractor.
-
A. They are defined and stored on the server.
-
B. They cannot store constant values.
-
C. They are supported only in calculation scripts.
-
They are supported only in load scripts.
-
Successful
-
Results in error
-
Depends on condition
-
None
B
Correct answer
Explanation
DML operations on views that contain GROUP BY, DISTINCT, or aggregate functions will result in an error. Oracle cannot map the operation back to underlying table rows.
-
By setting the object to Null
-
By setting the object to Nothing
-
With Close keyword
-
None of the above
B
Correct answer
Explanation
In VB.NET, objects are dereferenced and released for garbage collection by setting them to the Nothing keyword. Null is not used in VB.NET (unlike C#'s null), and Close terminates a connection or stream but does not dereference the object reference variable.
-
RaiseEvent keyword
-
TriggerEvent keyword
-
AddEvent Keyword
-
None
A
Correct answer
Explanation
VB.NET uses the RaiseEvent keyword as the standard mechanism for triggering events within a class. This is the built-in language feature that invokes all event handlers subscribed to that event. Options TriggerEvent and AddEvent are not valid VB.NET keywords - they do not exist in the language. When you need to fire an event in VB.NET, you use RaiseEvent followed by the event name.
-
<template>
-
<x:template>
-
<xsl>
-
<xsl:template>
D
Correct answer
Explanation
In XSLT (Extensible Stylesheet Language Transformations), templates are defined using the standard `` element. The other options are incorrect because they use invalid tag names or incorrect XML namespaces that do not conform to XSLT specifications.
-
%rowtype, %toomanyrows, %found
-
%found, %notfound, %rowcount
-
%rowtype, %rowcount, %notfound
-
None of the above
B
Correct answer
Explanation
Implicit cursor attributes in Oracle PL/SQL are SQL%FOUND (true if rows affected), SQL%NOTFOUND (opposite of FOUND), and SQL%ROWCOUNT (number of rows affected). These are available after any SQL statement.
E
Correct answer
Explanation
Perl's loop constructs include for, foreach, until, while, and do-while. The 'map' function is not a loop construct but a list processing function. The 'switch' statement (given/when in Perl 5.10+) is also not a traditional loop. Option e (switch) is correct as the non-loop answer. Note: Modern Perl has given/when for switch-like behavior.
-
CALLNAT
-
CALL Sub-routine
-
CALL
-
FETCH
A
Correct answer
Explanation
In Natural programming language, CALLNAT is the statement used to call a subprogram (another Natural object). The other options (CALL Sub-routine, CALL, FETCH) are not valid Natural syntax for calling subprograms.
C
Correct answer
Explanation
The ESCAPE statement in Natural interrupts the linear flow of execution, allowing exit from processing loops or routines. EXIT is not a Natural statement, DO and FOR are loop constructs. ESCAPE provides the exit mechanism.
B
Correct answer
Explanation
The FORMAT statement in Natural programming language is used to define how input and output parameters should be displayed and processed. It controls the formatting of data fields, such as number of decimal places, date formats, and string handling. The INPUT statement is for user interaction, IO is not a valid statement, and DEFINE is for variable declarations.