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. This function is used to convert the integer into float type.

  2. This method is used to convert the string of digits into the corresponding integer.

  3. This method is used to convert a string into an integer.

  4. This method is used to convert the characters into string format.

  5. None of the above

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

This is true about ''atoi' function in C language.

Multiple choice
  1. A null pointer is a special pointer that does not point anywhere.

  2. We can declare the null pointer as int *a=NULL.

  3. We can declare the null pointer as int *a=0.

  4. NULL is also known as pre-processor macro.

  5. None of the above

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

Yes, all are the true statements.

Multiple choice
  1. A function pointer is a function that is used to store the address of the function.

  2. Function pointers can be used to set callback functions.

  3. Virtual functions are implemented by the function pointers.

  4. All of the above are true.

  5. Only (1) and (3) are true.

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

Yes, all are the true statements.

Multiple choice
  1. C++ supports null pointers.

  2. int *ptr[abs] is the example of array of pointer to an integer.

  3. In C++, we can pass pointer to a function.

  4. All of the above.

  5. Only (1) and (3) are true.

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

Yes, all of the above three are the true statements.

Multiple choice
  1. Instruction selection

  2. Evaluation order

  3. Register allocation

  4. Common sub-expression elimination

  5. Target program

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

This is not an issue of code generator. It is a structure preserving transformation which removes repeated expression.