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

Multiple choice
  1. underflow

  2. overflow

  3. garbage value

  4. Both (1) and (2)

  5. None of these

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

POP is used to read the last value stored in a stack. If the stack is empty, an error condition, i.e. underflow will result on performing POP.

Multiple choice
  1. Transient

  2. do while

  3. Boolean

  4. Try

  5. Implements

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

Except “do while”, all the others are Java keywords. “do while” is a keyword of C programming language.

Multiple choice
  1. A keyword in C

  2. An error condition

  3. Standard output error stream

  4. Standard logging stream

  5. Operator in UNIX

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

C++ provides some basic input/output stream. Cerr is one of such streams used for standard output error.

Multiple choice
  1. while

  2. else if

  3. for

  4. do while

  5. None of these

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

Do while is a looping technique used in C programming, which first executes the statement and then checks the conditions. So, it is exit controlled. While and for are entry controlled.