...
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.
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!