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
-
int[,] myarray
-
int[][] myarray
-
int[2] myarray
-
none of above
B
Correct answer
Explanation
In C#, the default underlying type for enum is int, but the default value of the first enum member is 0, not 1. Unless explicitly assigned values, enum constants start at 0 and increment by 1 for subsequent members. This statement incorrectly states the default value is 1.
-
int[,] myarray
-
int[][] myarray
-
int[2] myarray
-
none of above
B
Correct answer
Explanation
In C#, a 2-dimensional array is declared using square brackets with a comma inside: int[,] myarray. This creates a rectangular array, while int[][] creates a jagged array (array of arrays).
-
Int, string ,date
-
Int, string ,float
-
Int, string, bool
-
Decimal, string, date
A
Correct answer
Explanation
RangeValidator in ASP.NET supports Integer, String, and Date data types. It does not support Float or Boolean values for range validation.
-
IL Code
-
Native code
-
Byte Code
-
None of these
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.
-
With OPTION STRICT ON keyword
-
With OPTION EXPICIT Keyword
-
With OPTION STRICT OFF keyword
-
All the above
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.
-
By setting the object to Null
-
With Close keyword
-
By setting the object to Nothing
-
None of the above
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.
-
def
-
lambda
-
filter
-
tokens
-
Options 1,2 and 3
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.
-
There is either a JCLLIB statement for the entireJOB, or a separate one for EXEC statement, not both.
-
A JCLLIB statement can not have a statement name.
-
There can only be one JCLLIB statement per JOB.
-
A JCLLIB statement must be coded before the first EXEC statement.
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.
-
COND=(8,LE)
-
COND=(8,GE)
-
COND=(8,LT)
-
COND=(8,GT)
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.
-
Main Method
-
<script></script> Block
-
<Body>
-
Macro
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.
-
There is either a JCLLIB statement for the entire JOB, or a separate one for each EXEC
-
A JCLLIB statement can not have a statement name.
-
There can only be one JCLLIB statement per JOB.
-
A JCLLIB statement must be coded before the first EXEC statement.
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.
-
COND=(8,LE)
-
COND=(8,GE)
-
COND=(8,LT)
-
COND=(8,GT)
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).
-
The COND parameter always indicates that if its condition is met, the step is NOT executed.
-
When adding the COND parameter to an EXEC statement that calls a procedure, this COND
-
With the COND parameter, we can only check return codes.
-
The COND parameter can check the return codes of multiple steps, but as soon as one of
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).