What will be the value of a in the statements given below? [code]TYPE color IS (red, green, blue, yellow, brown, black); VARIABLE a : color; a

Nam Lê

Member
What will be the value of a in the statements given below?
Code:
TYPE color IS (red, green, blue, yellow, brown, black);
VARIABLE a : color;
a := color’BASE’RIGHT;
…
A. red
B. color
C. green
D. black
 
Answer: d
Explanation: Since ‘BASE attribute can’t be used independently, here it is used in conjunction with ‘RIGHT attribute. So, first of all color’BASE will return type color and then the ‘RIGHT attribute will return the rightmost value in the specified type. So, a will be assigned with black.
 

Tìm kiếm

Back
Top