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. 3 HELLO

  2. 3 hello

  3. Error

  4. None of these

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

In C, you cannot initialize members inside a structure definition, nor can you declare an array without a size inside a structure unless it is a flexible array member. These syntax violations cause a compilation error.

Multiple choice
  1. 10

  2. 4

  3. 3

  4. Error

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

The array 'arr' is declared as const, meaning its contents are read-only. Passing the address of a const element to a function that attempts to modify it through a non-const pointer is a violation that results in a compiler error.

Multiple choice
  1. The NULL pointer can not be accessible by memory address.

  2. A NULL pointer does not have any memory pointer.

  3. int main () { int *ptr = NULL;NSLog(@"The value of ptr is : %xn", ptr ); return 0; } is the correct syntax for NULL pointer.

  4. The NULL pointer is a constant with a value of zero defined in several standard libraries.

  5. None of the above

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

All are correct statements about NULL pointer n Objective C.

Multiple choice
  1. 0

  2. negative

  3. positive

  4. none of these

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

The code provided is: If(num<=0) { If(num<0) print(negative) Else print(positive) }. If num is 0, the first condition (0<=0) is true. The inner condition (0<0) is false, so the else block executes, printing 'positive'.