Computer Knowledge

Programming Output Evaluation

1,721 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 technology operating systems
  1. 2450

  2. 1275

  3. 1225

  4. 2550

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

The for loop iterates through the sequence 1 to 50, so i takes values 1,2,3,...,50 (50 iterations). Inside the loop, 'let i=i+1' increments each value before printing. After the loop, i=50 (last assigned value). The echo prints 50, not a sum. However, this seems to be a trick question - if we sum 1+2+...+50 = 1275, which is option B. The question may intend the sum of the series.

Multiple choice technology programming languages
  1. 20

  2. 17+3

  3. 173

  4. CompileTime Error

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

When a string is concatenated with integers using the + operator, Java evaluates left-to-right. First "The answer is: " + 17 produces "The answer is: 17". Then that string is concatenated with 3 to produce "The answer is: 173". Once a string enters the expression, all subsequent + operations perform string concatenation, not arithmetic addition.

Multiple choice technology programming languages
  1. HELLO

  2. ELLO

  3. LLO

  4. LO

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

Pointer arithmetic moves the pointer 3 characters forward from H-E-L-L-O, so it points to L-L-O. The printf outputs from that position, printing LO. Options A, B, and C are incorrect pointer offsets.

Multiple choice technology programming languages
  1. True

  2. False

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

Iterators in Java are 'fail-fast' - they throw ConcurrentModificationException if the collection is modified during iteration (except through the iterator's own remove method). The iterator does not automatically update to reflect changes made directly to the collection during traversal.