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
-
code line
-
comment line
-
loop statement
-
none of these
B
Correct answer
Explanation
The single quote (') character in Visual Basic indicates the start of a comment. All text following the quote on that line is ignored by the compiler and used for documentation.
-
It means that the MSIL code cannot be JIT compiled by the CLR.
-
It provides the JIT code prevention.
-
In the stage of the verification process, the type safety is analysed after the declaration of the code.
-
The code passes the type-safety check. The CLR accepts that code is both valid and type-safe and allows it to be executed or referenced.
-
It makes the code typesafe.
A
Correct answer
Explanation
This is correct as it means JIT compiled code validity is not confirmed.
-
These occur when the environment you're programming in doesn't understand the code.
-
These errors occur when the programme is running.
-
An example is trying to access a file that doesn't exist.
-
This happens when the code doesn't quite behave the way it was supposed to.
-
These errors are responsible for robust code.
A
Correct answer
Explanation
This is a correct statement as the Design errors are the outcome of bad coding practices.
-
In this execution, the multiple versions of the same assembly can be managed and executed.
-
This execution has delivered the user from complications associated with DLL hell.
-
It is possible in an executable assembly to express a dependence on a particular support assembly.
-
It manage the execution process in dynamic assembly only.
-
The multiple versions of the assembly can be encrypted.
D
Correct answer
Explanation
This is incorrect because it can manage the execution process in any assembly.
-
The array can be redeclared implicitly.
-
It makes the preservation of the data of the original array.
-
It can be used to change an array from one data type to another.
-
It can produce exception in the code.
-
It produces the complexity problem in the code.
B
Correct answer
Explanation
This is correct because the ability to keep expanding the array is needed.
-
It is used to declare the name of a module and introduces the definition of the variables.
-
It is used to declare the name of an interface and introduces the definitions of the members.
-
It declares the name, parameters, and code that defines a Function procedure.
-
It declares the name, parameters and code that define a Sub procedure.
-
It defines the name of the module and the variables.
A
Correct answer
Explanation
This is correct and it includes the definition of the variables, properties, events and procedures that the module comprises.
-
It stops the program for a defined place.
-
It defines the memory storage mechanisms for the code.
-
It provides the data access points in the application code.
-
It manage the execution of the programme in the multiple steps.
-
It provides the database execution process.
A
Correct answer
Explanation
A breakpoint is like a note to VB.NET to stop the programme at a particular place.
-
Immediate Window
-
Local Window
-
Auto Window
-
Quick Watch Window
B
Correct answer
Explanation
The Locals window in Visual Studio debugger displays all variables and objects currently in scope at the selected line of execution. Unlike the Immediate Window (for commands) or Auto Window (variables near current line), Locals shows the complete scope. The question phrasing is awkward but refers to this debugging window.
-
Reference Parameters
-
Output Parameters
-
Aliases
-
Both (1) and (2)
B
Correct answer
Explanation
'Of' is not a reserved keyword in C#. Is, As, and In are all contextual keywords/reserved words. 'Of' is only used in generic type constraints (where T : IEnumerable) but is not a standalone keyword.
-
break
-
continue
-
return
-
none of these
D
Correct answer
Explanation
A finally block executes regardless of how the try block exits (exception or normal completion). Control flow statements like break, continue, and return cause the finally block to execute before the transfer occurs, but they cannot appear inside the finally block itself.
-
variant
-
voriant
-
var
-
varient
A
Correct answer
Explanation
VBScript's default data type is 'variant', which can hold any type of data. The other options are misspellings: voriant (typo), var (JavaScript-like), varient (misspelled). The correct answer is A (variant).
-
Item()
-
Key()
-
CompareMode()
-
Exists()
-
lock
-
volatile
-
out
-
namespace
-
form
E
Correct answer
Explanation
Form is not a keyword in C#. It represents a visual window or frame that can be used to place user interface controls like buttons, labels or listbox.
-
Function definitions can be nested.
-
A function can only return one value at a time.
-
To return the control from middle of a function, the return clause should be used.
-
Function calls can be nested.
-
Functions can be called recursively.
A
Correct answer
Explanation
We can call a function from within another function but we cannot define a function inside another. The functions must be defined independent of each other.