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. SELECT CASE

  2. single-alternative block IF

  3. double-alternative block IF

  4. END

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

SELECT CASE and both single-alternative and double-alternative block IF statements are all control structures that direct program flow. END is a termination keyword used to close blocks, but it doesn't control program flow itself. END simply marks the conclusion of a block structure like IF or SELECT CASE.

Multiple choice
  1. Inquiry-and-response

  2. Print

  3. Control

  4. Flowcharting

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

Control statements like IF, SELECT CASE, and loops allow programmers to alter the sequential execution of a program. Inquiry-and-response handles user input, Print displays output, and Flowcharting is a design tool. Only control statements actively change the flow of program execution by making decisions or repeating actions based on conditions.

Multiple choice
  1. END

  2. END BLOCK

  3. ELSEIF

  4. END IF

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

In block IF structures, the block must be properly terminated. The END IF statement marks the conclusion of the IF block. While END alone terminates other structures like SELECT CASE, the specific syntax for block IF requires END IF to properly close the conditional block and maintain code clarity.

Multiple choice
  1. An error message is displayed.

  2. The program will execute the statement immediately before the block IF statement.

  3. The block IF statement is executed again.

  4. The first statement following the non-executable statement is executed.

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

Non-executable statements like REM (remark/comment) are ignored during program execution. When a non-executable statement appears after a block IF, the program simply skips it and continues to the next executable statement. The block IF has already been evaluated, and execution proceeds to the first executable instruction following the REM statement. No error occurs, and the IF is not re-executed.

Multiple choice
  1. collating sequence

  2. boolean operator

  3. menu

  4. relational operator

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

A menu is a user interface element that displays a list of available program functions or options. Users select one item from the menu to invoke that specific function. Collating sequences determine character ordering, boolean operators combine logical conditions, and relational operators compare values - none of these display selectable function lists.

Multiple choice
  1. Both THEN and ELSE clauses may be executed

  2. ELSE clause is always executed

  3. Either THEN or ELSE clause will be executed

  4. THEN clause is always executed

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

In a double-alternative block IF, the condition is evaluated once. If true, the THEN clause executes and the ELSE clause is skipped. If false, the ELSE clause executes and the THEN clause is skipped. Only one of the two clauses ever executes during a single pass through the IF statement - never both, and never neither.

Multiple choice
  1. None; the statement is skipped.

  2. The THEN part of the statement is executed.

  3. The ELSE part of the statement is executed.

  4. Both the THEN and the ELSE parts of the statement are executed.

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

In an IF-THEN-ELSE structure, when the condition evaluates to true, only the THEN clause is executed. The ELSE clause is skipped entirely.

Multiple choice
  1. concurrency

  2. conception

  3. configure

  4. concatenation

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

Concatenation is the operation of joining two or more strings end-to-end to create a single combined string. This is a fundamental string operation in programming, used extensively in text processing, formatting output, and building file paths. The term comes from Latin meaning 'to link together'.

Multiple choice
  1. Syntactic error debugging in a program is the process of identifying and correcting errors.

  2. Run-time or logical error debugging in a program is the process of identifying and correcting errors.

  3. Debugging through the Internet is the process of downloading a large file.

  4. Debugging is the process of defragmenting a hard disk.

  5. None of these

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

Option (2) is correct.