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. There is no error and program will execute normally.

  2. Preprocessor directives are not used in the program.

  3. A function cannot be declared above main.

  4. Return statement should not be used with conditional operators.

  5. None of the above

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

return keyword cannot be used with conditional operator or with ternary operator. 

Multiple choice
  1. Border of table handler and dynamic creater of row and cell

  2. Row handler and cell handler

  3. Border handler and size handler

  4. Column handler and cell handler

  5. None of the above

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

The two handlers of Table page class are known as Border of table handler and dynamic creater of row & cell.

Multiple choice
  1. ratio = boys/girls;

  2. ratio = girls/boys;

  3. ratio = (float) girls/boys;

  4. ratio = (float) boys/girls;

  5. ratio = float boys/girls;

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

Cast operator is required to convert the boys/girls calculation in decimal precision. Cast operator can be used to explicitly convert the value of an expression to a different data type.

Multiple choice
  1. jump the control to specific location o screen

  2. hold the control for user input

  3. end the program execution

  4. restart the execution from beginning

  5. jump the control up or down at its label

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

The goto statement is used to jump the control in a program to its label in the function irrespective of its place in the sequence of coding.