Computer Knowledge

Programming Fundamentals

2,381 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. round-off errors.

  2. syntax errors.

  3. run-time errors.

  4. logic errors.

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

In numerical computing, performing many operations with floating-point numbers leads to the accumulation of small inaccuracies known as round-off errors. Syntax, run-time, and logic errors are distinct categories of programming mistakes.

Multiple choice
  1. procedural statements.

  2. non procedural statements.

  3. both (1) & (2)

  4. loop statement.

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

Application generators often allow users to define what the program should do (non-procedural) while also providing hooks or extensions for custom logic (procedural), thus combining both.

Multiple choice
  1. iteration

  2. rendezvous statement

  3. exception statement

  4. all of the above

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

Control structures define the flow of execution in a program. Iteration (loops), rendezvous statements (in concurrent programming), and exception handling are all mechanisms used to manage program flow.

Multiple choice
  1. sequence

  2. choice

  3. iteration

  4. none of the above

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

Iteration is the control structure that allows a block of code to be executed repeatedly, forming a loop. Sequence is the default execution order, and choice refers to conditional branching.

Multiple choice
  1. a machine language program

  2. an assembly language program

  3. a BASIC program

  4. a PASCAL program

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

Pascal is a strongly typed language that requires all variables to be declared in a specific declaration block before they are used in the program body. Machine and assembly languages do not have this high-level declaration requirement.

Multiple choice
  1. When the inline function definition is too long or too complicated

  2. When the inline function is recursive

  3. When the inline function has looping constructs

  4. When the inline function has a switch or a goto statement

  5. When the inline function starts with the keyword 'inline'

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

This is a situation where an inline function may work in C++ as an inline function must start with the keyword 'inline'.

Multiple choice
  1. we use * before it in its declaration

  2. we use ** before it in its declaration

  3. we use *** before it in its declaration

  4. all of the above

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

null