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. To make the code easier to read.

  2. To indicate the start of a new line.

  3. They are not used.

  4. To maintain order of the lines at compile time.

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

C source code is a plain text file. Line numbers are not part of the syntax and are not required by the compiler; they are only added by text editors for the convenience of the programmer.

Multiple choice
  1. Both i and iii. are true

  2. Both ii. and iv. are true

  3. Both i. and ii. are true

  4. Both iii. and iv. are true

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

This answer is correct. Java only supports pass by value not pass by reference. The primitive data types are passed by value. Also, since no object defined for primitive types, primitive data types are passed only by value.

Multiple choice
  1. i. and ii both are correct.

  2. i. and iv. both are correct.

  3. ii. and iii. both are correct.

  4. ii. only is correct

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

This answer is correct. When the automatic type conversion has to happen between two variables, then both the data types should be compatible and also the destination type should be larger than the source type.

Multiple choice
  1. frame check sequence

  2. checksum

  3. flow control

  4. frame bursting

  5. fourier analysis

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

This is the correct option. Frame check sequence (FCS) refers to the extra bits and characters added to data packets for error detection and control. FCS technology is one of the best error control techniques and remains popular because of its simplicity.

Multiple choice
  1. inserting a '0' is user data stream to differentiate it with a flag

  2. inserting a '0' in flag stream to avoid ambiguity

  3. appending a nibble to the flag sequence

  4. appending a nibble to the user data stream

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

Bit stuffing (often called bit stuffing, not snuffing) is the process of inserting a bit (usually a 0) into a data stream to prevent a sequence of bits from being misinterpreted as a control flag.

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.