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
  1. code line

  2. comment line

  3. loop statement

  4. none of these

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

Multiple choice
  1. It means that the MSIL code cannot be JIT compiled by the CLR.

  2. It provides the JIT code prevention.

  3. In the stage of the verification process, the type safety is analysed after the declaration of the code.

  4. 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.

  5. It makes the code typesafe.

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

This is correct as it means JIT compiled code validity is not confirmed.

Multiple choice
  1. These occur when the environment you're programming in doesn't understand the code.

  2. These errors occur when the programme is running.

  3. An example is trying to access a file that doesn't exist.

  4. This happens when the code doesn't quite behave the way it was supposed to.

  5. These errors are responsible for robust code.

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

This is a correct statement as the Design errors are the outcome of bad coding practices.

Multiple choice
  1. In this execution, the multiple versions of the same assembly can be managed and executed.

  2. This execution has delivered the user from complications associated with DLL hell.

  3. It is possible in an executable assembly to express a dependence on a particular support assembly.

  4. It manage the execution process in dynamic assembly only.

  5. The multiple versions of the assembly can be encrypted.

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

This is incorrect because it can manage the execution process in any assembly.

Multiple choice
  1. The array can be redeclared implicitly.

  2. It makes the preservation of the data of the original array.

  3. It can be used to change an array from one data type to another.

  4. It can produce exception in the code.

  5. It produces the complexity problem in the code.

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

This is correct because the ability to keep expanding the array is needed.

Multiple choice
  1. It is used to declare the name of a module and introduces the definition of the variables.

  2. It is used to declare the name of an interface and introduces the definitions of the members.

  3. It declares the name, parameters, and code that defines a Function procedure.

  4. It declares the name, parameters and code that define a Sub procedure.

  5. It defines the name of the module and the variables.

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

This is correct and it includes the definition of the variables, properties, events and procedures that the module comprises.

Multiple choice
  1. It stops the program for a defined place.

  2. It defines the memory storage mechanisms for the code.

  3. It provides the data access points in the application code.

  4. It manage the execution of the programme in the multiple steps.

  5. It provides the database execution process.

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

A breakpoint is like a note to VB.NET to stop the programme at a particular place.

Multiple choice
  1. Immediate Window

  2. Local Window

  3. Auto Window

  4. Quick Watch Window

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

Multiple choice
  1. Is

  2. Of

  3. As

  4. In

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

Multiple choice
  1. break

  2. continue

  3. return

  4. none of these

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

Multiple choice
  1. variant

  2. voriant

  3. var

  4. varient

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

Multiple choice
  1. lock

  2. volatile

  3. out

  4. namespace

  5. form

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

Multiple choice
  1. Function definitions can be nested.

  2. A function can only return one value at a time.

  3. To return the control from middle of a function, the return clause should be used.

  4. Function calls can be nested.

  5. Functions can be called recursively.

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