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 programming languages
  1. SSRANGE

  2. NOSSRANGE

  3. RANGE

  4. None of the above

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. end-evaluate

  2. exit

  3. continue

  4. None of the above

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology testing
  1. We can assign the object to a variable

  2. We can use With and End with statements

  3. We should use them every time

  4. None of the above

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology testing
  1. Dynamic

  2. Tertiary

  3. Static

  4. Both 1 and 3

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology
  1. A For Each…Next loop.

  2. A Do...Loop.

  3. A Loop-dee-Loop.

  4. None of the above

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology databases
  1. Successful

  2. Results in error

  3. Depends on condition

  4. None

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. By setting the object to Null

  2. By setting the object to Nothing

  3. With Close keyword

  4. None of the above

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. RaiseEvent keyword

  2. TriggerEvent keyword

  3. AddEvent Keyword

  4. None

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. <template>

  2. <x:template>

  3. <xsl>

  4. <xsl:template>

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology databases
  1. %rowtype, %toomanyrows, %found

  2. %found, %notfound, %rowcount

  3. %rowtype, %rowcount, %notfound

  4. None of the above

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. a

  2. b

  3. c

  4. d

  5. e

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology mainframe
  1. INPUT

  2. FORMAT

  3. IO

  4. DEFINE

Reveal answer Fill a bubble to check yourself
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.