Computer Knowledge

Programming Fundamentals

2,381 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
  1. MakeNull

  2. SetNull

  3. NullToEmpty

  4. IfNull

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

IfNull is primarily a SQL function (like MySQL's IFNULL), not a DataStage transformer function. DataStage uses SetNull(), MakeNull(), NullToEmpty(), IsNull(), and NullToValue() for null handling. The question tests familiarity with DataStage-specific function names versus generic SQL functions.

Multiple choice technology mainframe
  1. Scope terminator is used to mark the end of a verb

  2. Scope terminator is used to mark the end of a statement

  3. Both 1 and 2

  4. None of the above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

A scope terminator marks the end of a verb or statement in COBOL. Explicit scope terminators like END-IF, END-PERFORM, END-READ make the code more readable and prevent ambiguity by clearly defining where a conditional or iterative construct ends. Both options 1 and 2 correctly describe the purpose of scope terminators.

Multiple choice technology mainframe
  1. IF THEN/ELSE

  2. COND

  3. BOTH

  4. Steps cannot be skipped in JCL.

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

JCL steps can be skipped using both conditional processing methods. The COND parameter tests return codes from previous steps. IF/THEN/ELSE (or IF/THEN/ELSE/ENDIF) constructs provide conditional logic. Statement D is false - steps can indeed be conditionally executed or skipped.

Multiple choice technology mainframe
  1. IF THEN/ELSE

  2. COND

  3. BOTH

  4. Steps cannot be skipped in JCL.

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

JCL steps can be skipped using both conditional processing methods. The COND parameter tests return codes from previous steps. IF/THEN/ELSE (or IF/THEN/ELSE/ENDIF) constructs provide conditional logic. Statement D is false - steps can indeed be conditionally executed or skipped.

Multiple choice technology mainframe
  1. IF THEN/ELSE

  2. COND

  3. BOTH

  4. Steps cannot be skipped in JCL.

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

JCL steps can be skipped using both COND parameters on EXEC statements and IF/THEN/ELSE construct statements. COND conditionally skips based on return codes from previous steps. IF/THEN/ELSE provides more complex conditional logic. Both are valid methods for conditional execution.

Multiple choice technology databases
  1. 1, 2 and 4 are true

  2. all statements are valid

  3. Only 4 an d 5 are true

  4. 1, 4 and 5 are true

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Simple loops have no built-in entry or exit criteria; they execute indefinitely until manually exited. Statements 1 and 2 are false (no automatic criteria), while 4 and 5 are true (manual exit needed, otherwise infinite loop). Option C is correct.

Multiple choice technology databases
  1. The exception B will be handled in inner block

  2. The exception B will be handled in outer block exception handler

  3. The exception will not be handled as there is no handler defined for B in inner block

  4. The exception section in inner block is executed and also Outer block exception section as we have defined there too

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

When exception B is raised in the inner block's ELSE clause, it has no matching handler in that inner block (which only handles A). Unhandled exceptions propagate to the enclosing block, where B is caught. Option B correctly describes this propagation behavior.

Multiple choice technology databases
  1. If the function exists, it will be dropped and replaced with the new version created by the statement.

  2. If the function does not exist, it will create a new one.

  3. No action will be taken

  4. There is no such option available.

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The REPLACE clause tells the database to drop an existing function of the same name and create the new definition instead of raising an error. This is precisely what the stored answer describes, so it is correct.

Multiple choice technology programming languages
  1. Procedures do not return values

  2. Functions do not return values

  3. Procedure always return values

  4. None of these.

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Historically, functions must return a value, while procedures do not. Note that procedures can return values via OUT parameters in many databases, but standard definition-level differentiation is that procedures do not return values directly via a RETURN statement.

Multiple choice technology databases
  1. Both are same

  2. case can check for non equality operator but decode checks for equality operator

  3. decode can be used for comparing value of one variable/condition. but case can check for multiple conditions

  4. case can not be used in where clause. but decode can be used.

Reveal answer Fill a bubble to check yourself
B,C Correct answer
Explanation

In PL/SQL and SQL, CASE statements support complex logical conditions and non-equality operators (like < or >), whereas DECODE is limited to equality checks. CASE also handles multiple distinct conditions. Distractors incorrectly equate them.

Multiple choice technology testing
  1. Buil-in

  2. User-defined

  3. User-function

  4. Buil-in,User-defined

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

QuickTest supports two types of environment variables: built-in variables provided by the system, and user-defined variables created by testers. This combination allows flexibility in test configuration.

Multiple choice technology programming languages
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The main method CAN be overloaded - you can have multiple methods named 'main' with different parameter lists. However, only the standard main(String[] args) serves as the JVM entry point. Other overloaded main methods must be called explicitly like any other method. This is a common confusion point.

Multiple choice technology programming languages
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Java allows the main method to be declared with any of the usual modifiers, including final. Declaring it final simply prevents the method from being overridden, which never happens for static methods anyway, so the statement is valid. The stored answer (True) is therefore correct.