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. nose

  2. back

  3. ear

  4. None of these

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

In LOGO turtle graphics, the turtle is an isosceles triangle. The pointed vertex that indicates the direction of movement is called the nose.

Multiple choice
  1. Inline functions

  2. Constructors

  3. Destructors

  4. None of the above

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

Inline functions are very useful when we need to create efficient code as their code is expanded each time they are invoked. Inline functions are preceded by inline keyword. For example: inline int findlarge(int x, int y) {return x > y ? x : y;}. Hence, this is the correct answer.

Multiple choice
  1. Function declaration is correct.

  2. Parameter cannot be given default value in function declaration.

  3. All parameters that take default value, must appear to right of those that do not.

  4. Default argument of parameter cannot be zero.

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

This option is correct as the only problem with the above function declaration is that a is intialized, but b is not. However, if a is intialized then b should also be initialized as explained in above option.

Multiple choice
  1. Inline

  2. Continue

  3. Return

  4. Overload

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

Overload keyword is now obsolete and is no longer used or supported. It is not a part of Standard C++. It was preceded with function name in its definition to indicate that it was an overloaded function. Hence, this is the correct answer.