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 testing
  1. View

  2. Variables

  3. Command

  4. Current

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

The Command tab in QTP/UFT's Debug Viewer is specifically designed to execute VBScript statements during debugging. You can type and run single-line scripts to inspect or modify variable values in real-time.

Multiple choice technology mainframe
  1. End

  2. Stop Run

  3. Stop

  4. End-If

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

STOP RUN is the COBOL statement that terminates program execution. It closes all files and returns control to the operating system. END is used to end procedures (like END-EVALUATE), not programs. STOP alone is incorrect. END-IF terminates an IF statement block, not the program.

Multiple choice technology web technology
  1. True

  2. False

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

Casting between datatypes can succeed but produce illegal values (e.g., casting a large double to int silently truncates), while Convert methods throw exceptions for invalid operations (e.g., Convert.ToInt32("abc") throws FormatException). Casting is unchecked; Convert validates the operation.

Multiple choice technology programming languages
  1. True

  2. False

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

In Java, sizeof is an operator (not available at the language level in Java - it exists in C/C++), but it is NOT a reserved keyword. Java has no sizeof keyword because memory size is platform-independent. Therefore the statement 'Is sizeof a keyword' is False, making the claimed answer correct.

Multiple choice technology programming languages
  1. Value type variables are stored on stack. Reference type variables are stored on heap.

  2. Value type holds the data directly, Reference type points to the location that holds the data.

  3. Value type cannot contain null value. Reference type can contain null value.

  4. A new type cannot be derived from value type. A new type can be derived from reference type.

  5. All of the above

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

Value types and reference types differ in multiple ways: storage location (stack vs heap), data handling (direct vs pointer), nullability (value types cannot be null), and inheritance (value types are sealed). All options A-D are correct differences, making option E the right answer.

Multiple choice technology web technology
  1. Packages can be nested.

  2. You can pass parameters to packages.

  3. A package is loaded into memory each time it is invoked.

  4. The contents of packages can be shared by many applications.

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

PL/SQL packages are stored database objects whose specifications and bodies can be shared across multiple applications. Packages cannot be nested, cannot accept parameters directly (though their subprograms can), and are loaded into memory once per session rather than on every invocation.

Multiple choice technology databases
  1. "&"

  2. ACCEPT

  3. PROMPT

  4. "&&"

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

The && (double ampersand) substitution variable retains its value after first use, eliminating repeated prompts. The & variable prompts each time it's referenced. ACCEPT and PROMPT are commands for interactive input, not substitution variables. && is the correct choice for reuse without prompting.

Multiple choice technology programming languages
  1. CALL FUNCTION

  2. CALL SCREEN

  3. CALL TRANSACTION

  4. CALL PROGRAM

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

To understand this question, the user needs to know about CALL statements in programming. CALL statements are used to call other programs or functions within a program.

Now, let's go through each option and explain why it is right or wrong:

A. CALL FUNCTION: This is a valid statement in programming. It is used to call a specific function within a program.

B. CALL SCREEN: This is also a valid statement in programming. It is used to call a specific screen within a program.

C. CALL TRANSACTION: This is a valid statement in programming. It is used to call a specific transaction within a program.

D. CALL PROGRAM: This is NOT a valid statement in programming. The correct statement is CALL FUNCTION, which is used to call a specific function within a program.

Therefore, the answer is: D

Multiple choice technology mainframe
  1. This value is stored in the system variable RESULT.

  2. This value is stored in the system variable RC.

  3. This value can be alphanumeric.

  4. This value must be numeric.

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

In REXX, a subroutine returns a value using the RETURN clause, which is automatically saved in the special variable RESULT. This returned value is a character string and can be alphanumeric.

Multiple choice technology architecture
  1. 10

  2. 20

  3. Upon integer overflow

  4. Will never complete

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

The code for(;;) is an infinite loop in C and C-like languages. The semicolons indicate an empty condition, which evaluates to true, creating a loop that never terminates. The function foo() contains this infinite loop and never returns. Therefore main() never completes after calling foo(). The program will run forever unless externally terminated. Option D is correct - the code will never complete.