Computer Knowledge

Programming Output Evaluation

1,953 Questions

Programming output evaluation tests the ability to trace code execution in languages like C, Java, and SAS. It focuses on arrays, loops, pointers, and data type conversions. These technical questions are standard in computer knowledge sections for IT officer and bank exams.

Java string bufferC language pointersLoop execution outputsData type conversionsMacro variable evaluation

Programming Output Evaluation Questions

Multiple choice
  1. 9 times

  2. 10 times

  3. 11 times

  4. compile time error

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

In a for loop, the condition is checked at the start of every iteration and once more after the final increment when the condition becomes false. For i=0 to 9, it is checked 11 times (for i=0, 1, 2, 3, 4, 5, 6, 7, 8, 9, and finally for i=10).

Multiple choice
  1. True

  2. False

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

The default implementation of the equals() method in the base java.lang.Object class compares object references using the == operator. Therefore, unless a class overrides equals(), calling obj1.equals(obj2) is functionally identical to obj1 == obj2.

Multiple choice
  1. console.log(5);

  2. console.print(5);

  3. print(5)

  4. print.console(5);

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

The standard method for writing messages or values to the web console in JavaScript is 'console.log()'. Other options like 'print()' or 'console.print()' are either incorrect or perform different actions (such as opening the print dialog).