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. address of a varible

  2. indication of a variable

  3. variable which stores the address of another varible

  4. none of the above

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

A pointer is a variable that stores the memory address of another variable, allowing for indirect access to data.

Multiple choice
  1. looping

  2. iteration

  3. condition

  4. all of the above

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

If-else statements are control flow structures used to execute code blocks based on the evaluation of a boolean condition. They are not used for looping or iteration directly.

Multiple choice
  1. ending of the loop

  2. beginning of the loop

  3. middle of the loop

  4. none of the above

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

In a do-while loop, the 'do' keyword marks the beginning of the loop block, while the condition is checked at the end.

Multiple choice
  1. address of a varible

  2. indication of a variable

  3. variable which stores the address of another variable

  4. none of the above

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

A pointer is a variable that stores the memory address of another variable, allowing indirect access to the data stored at that address.

Multiple choice
  1. LIFO

  2. FIFO

  3. FILO

  4. None of the above

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

A stack is a linear data structure that follows the Last-In, First-Out (LIFO) principle, where the last element added is the first one to be removed.

Multiple choice
  1. 32767

  2. � 32767

  3. 1.7014e+38

  4. �1.7014e+38

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

A 16-bit signed integer uses one bit for sign, leaving 15 bits for magnitude. The maximum value is 2^15 - 1 = 32767. This is a standard limit in older C implementations with 16-bit ints.

Multiple choice
  1. address of operator

  2. value at address

  3. address of a variable

  4. none of these

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

The asterisk (*) operator, when used in pointer notation, is the dereference operator, which retrieves the value stored at the memory address held by the pointer.

Multiple choice
  1. 's' is a float variable

  2. 's' is going to contain a floating point value

  3. 's' contains the address of a floating point variable

  4. none of these

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

The declaration float *s defines s as a pointer to a float, meaning it holds the memory address where a float value is stored.