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. IL Code

  2. Native code

  3. Byte Code

  4. None of these

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

The vbc.exe (Visual Basic Command-Line Compiler) generates IL (Intermediate Language) code, not native code. This IL code is then compiled to native code by the JIT (Just-In-Time) compiler at runtime by the CLR. This is consistent with how all .NET languages work - they compile to IL, not directly to native machine code.

Multiple choice technology programming languages
  1. With OPTION STRICT ON keyword

  2. With OPTION EXPICIT Keyword

  3. With OPTION STRICT OFF keyword

  4. All the above

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

The Option Strict On statement enforces strict type checking in VB.NET, preventing implicit narrowing conversions and late binding. Option Explicit ensures all variables are declared, while Option Strict Off disables strict type checks, making the first option the correct choice.

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

  2. With Close keyword

  3. By setting the object to Nothing

  4. None of the above

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

VB.NET uses the Nothing keyword to release object references and allow garbage collection, which is equivalent to null in C#. The Null keyword does not exist in VB.NET, and Close is a method used for releasing resources, not dereferencing.

Multiple choice technology programming languages
  1. def

  2. lambda

  3. filter

  4. tokens

  5. Options 1,2 and 3

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

The question asks about important features of Python functions. def is the keyword for defining named functions, lambda creates anonymous functions, and filter() is a built-in function that applies a function to filter sequences. All three are fundamental to Python's functional programming capabilities. tokens is not a special function feature.

Multiple choice technology mainframe
  1. There is either a JCLLIB statement for the entireJOB, or a separate one for EXEC statement, not both.

  2. A JCLLIB statement can not have a statement name.

  3. There can only be one JCLLIB statement per JOB.

  4. A JCLLIB statement must be coded before the first EXEC statement.

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

JCLLIB statements must follow specific rules: only one JCLLIB statement is allowed per JOB (C is true), and it must be coded before the first EXEC statement (D is true) because it establishes the library search order. Statement A is false - you can have JCLLIB at both JOB and EXEC level. Statement B is false - JCLLIB is a statement that can be named.

Multiple choice technology mainframe
  1. COND=(8,LE)

  2. COND=(8,GE)

  3. COND=(8,LT)

  4. COND=(8,GT)

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

In IBM JCL, COND=(value,operator) tests the return codes of prior steps. The step is bypassed (not executed) if the condition is true. To execute only if the return code is strictly less than 8, we bypass when the code is greater than or equal to 8. Thus, COND=(8,LE) (meaning bypass if 8 is less than or equal to the return code) is correct.

Multiple choice technology web technology
  1. Main Method

  2. <script></script> Block

  3. <Body>

  4. Macro

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

In Dojo 1.x, dojo.require() calls should be placed in a script block, typically after the dojo.js is loaded. This is commonly done in the main HTML file, often in the head section or at the beginning of the body. The 'Main Method' option likely refers to the main script block where Dojo modules are initialized. The key is that dojo.require must be in a script tag, not in body tags directly or in macros.

Multiple choice technology mainframe
  1. There is either a JCLLIB statement for the entire JOB, or a separate one for each EXEC

  2. A JCLLIB statement can not have a statement name.

  3. There can only be one JCLLIB statement per JOB.

  4. A JCLLIB statement must be coded before the first EXEC statement.

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

JCLLIB statement rules in JCL are specific. Option C is correct because only one JCLLIB statement is allowed per JOB - it defines the private library for the entire job. Option D is correct because JCLLIB must be placed before the first EXEC statement in the job. Option A is incorrect because JCLLIB is job-scoped, not per EXEC. Option B is incorrect because JCLLIB is a statement type itself and follows JCL naming rules. The JCLLIB statement enables cataloged procedure access by specifying a private library search order.

Multiple choice technology mainframe
  1. COND=(8,LE)

  2. COND=(8,GE)

  3. COND=(8,LT)

  4. COND=(8,GT)

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

In JCL, COND parameters test if a condition is true to bypass/skip execution. To execute only if the previous return code (RC) is strictly less than 8, we want to bypass if RC is greater than or equal to 8. Hence, COND=(8,LE) is correct because it bypasses execution if 8 is Less than or Equal to RC (meaning RC >= 8).

Multiple choice technology mainframe
  1. The COND parameter always indicates that if its condition is met, the step is NOT executed.

  2. When adding the COND parameter to an EXEC statement that calls a procedure, this COND

  3. With the COND parameter, we can only check return codes.

  4. The COND parameter can check the return codes of multiple steps, but as soon as one of

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

The COND parameter controls conditional step execution based on previous step return codes. Option B is correct because a COND parameter on an EXEC calling a procedure applies to ALL steps in that procedure, not just the first. Option D is correct because COND can test multiple step return codes - if any condition is true, the step is bypassed. Option A is incorrect because COND only skips execution when its condition evaluates TRUE (meaning the condition was met). Option C is incorrect because COND tests return codes, not just checks them - it evaluates whether codes meet specified comparison criteria (EQ, NE, GT, LT, GE, LE).