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. It debuggs a program easily.

  2. It consumes less disk space.

  3. Recursive calls to function is possible.

  4. Testing a program becomes easier.

  5. Complexity of a program is reduced.

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

This is the correct option as usage of function in the program consumes more disk space than without using a function.

Multiple choice
  1. Calling a function from another function

  2. Calling a same function with different form

  3. Calling a function from itself

  4. Calling a same function in same form every time

  5. There is no such term in C++

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

This is the correct option as calling the same function in different form allows a user to perform multiple operation with the same function and hence called as function overloading.

Multiple choice
  1. 'If' block should always be associated with an 'else' block

  2. The default scope of the 'if' statement is only the next statement.

  3. '!' is a unary operator.

  4. Switch statement can be used for decision making.

  5. '&' and '&&' have different meanings.

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

If block need not always be associated with an else block. However, an else block is always associated with an if block.

Multiple choice
  1. This function is used to determine that the value of the variable is not a string.

  2. This function is used to determine that the value of the variable is not a number.

  3. This function is used to determine that the value of the variable is not a boolean.

  4. None of the above

  5. There is no such function in java script.

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

This is a true statement about Nan() function.

Multiple choice
  1. The do-while loop is faster than the while loop.

  2. The do-while loop is slower than the while loop.

  3. There is no difference.

  4. In a do-while loop, the statement always executes at least once.

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

In a do-while loop, the condition comes after the statement. So, the statement always executes at least once.

Multiple choice
  1. Declaration of variable 'a' without definition

  2. Definition of variable 'a'

  3. Declaration and definition of variable 'a'

  4. Declaration of function pointer 'a'

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

Extern is used for declaring and not defining.

Multiple choice
  1. A reference must be initialised, when it is created.

  2. Once a reference is initialized to an object, it cannot be changed to refer to another object.

  3. NULL references are not allowed.

  4. When a reference is used as a function argument, any modification to the reference inside the function will not cause changes to the argument outside the function.

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

It is NOT a property of the C++ reference. It shows incorrect understanding of C++ reference concepts.

Multiple choice
  1. This function is used to compare the two strings.

  2. This method returns true, if both the strings are identical.

  3. This method returns false, if both of the strings are not equal.

  4. All of the above

  5. None of the above

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

This is true about strcmp() function.