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
  1. The result is 35.

  2. The result is 47.

  3. The result is 45.

  4. The result is 35.

  5. There is error in the program.

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

The correct answer is 45.

Multiple choice
  1. Program will find the sum of digits.

  2. Program will find the number of digits.

  3. Invalid

  4. Program will run infinite times.

  5. There will be error in the program.

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

This option is correct.

Multiple choice
  1. The program will find the sum of digits.

  2. The program will find the number of digits.

  3. Invalid

  4. The program will run infinite times.

  5. There is a error in the program.

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

This option is correct.

Multiple choice
  1. a string

  2. a char

  3. an int

  4. all of the above

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

The ostream.put() method in C++ is specifically designed to write a single character to the output stream. It takes a char as parameter and writes it to the stream.

Multiple choice
  1. Num=12

  2. Num=13

  3. Garbage value

  4. Error in the program

  5. Blank screen (no output)

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

There is an error in the program. We have declared the num variable as constant by const keyword. So, in this program we cannot modify its value. The compiler will give an error that “ cannot modify the constant object” or “[error] increment of read only variable num”. So, this option is true.

Multiple choice
  1. u=1

  2. u=2

  3. u=65535

  4. error in the program

  5. None of these

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

This is the correct answer. Unsigned integer has a maximum value range 0-65535. So, this is the maximum value. So, u=65535 will be printed. After reaching the last range compiler will start from beginning like for 65636, output will be 1, and for 65537, output will be 2. So, this option is true.

Multiple choice
  1. setLocation(int, int)

  2. setVisible(Boolean)

  3. setSize(int, int)

  4. setDefaultCloseOperation(int)

  5. Pack()

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

This is the correct answer.