...
DSSSB TGT 2021
August 6, 2024
Compiler-Design
August 7, 2024
DSSSB TGT 2021
August 6, 2024
Compiler-Design
August 7, 2024

Compilers

Question 4

For the program segment given below, which of the following are true?

 program main (output);
 type link = ^data;
      data = record
         d : real;
         n : link
         end;
 var ptr : link;
 begin
    new (ptr);
    ptr:=nil;
    .ptr^.d:=5.2;
    write ln(ptr)
 end. 
A
The program leads to compile time error
B
The program leads to run time error
C
The program outputs 5.2
D
The program produces error relating to nil pointer dereferencing
E
None of the above
Question 4 Explanation: 
Note: Out of syllabus.
Correct Answer: D
Question 4 Explanation: 
Note: Out of syllabus.

Leave a Reply

Your email address will not be published. Required fields are marked *