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 general knowledge
  1. Syntax error

  2. Symantic error

  3. Logical error

  4. Internal error

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

Compilers check source code against the language's grammar rules and report violations as syntax errors. These include missing semicolons, unmatched brackets, or incorrect keyword usage. Semantic errors relate to meaning (e.g., type mismatches) and may only be caught by some compilers, while logical errors (bugs) and internal errors are runtime or system issues beyond compilation.

Multiple choice general knowledge science & technology
  1. P contains the address of an element in DATA.

  2. P points to the address of first element in DATA

  3. P can store only memory addresses

  4. P contain the DATA and the address of DATA

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

In programming, a pointer is a variable whose value is the memory address of another variable. While it can store addresses, the functional definition is that it 'points' to the location of data.

Multiple choice softskills creativity
  1. zero only

  2. ZERO or Void Pointer

  3. Zero or void

  4. none

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

In C programming, NULL is a macro that expands to either 0 or a void pointer (void*) depending on context. It represents a null pointer constant. The correct answer captures both possibilities. Option C is similar but 'void' alone is not a pointer type.

Multiple choice softskills creativity
  1. True

  2. False

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

This statement is valid in Java. The 'new Integer(12)' creates an Integer object through autoboxing, and 'int _samId' unboxes it to a primitive int. The double underscore in '_samId' is a valid variable name in Java. This is syntactically correct and will compile.