views:

112

answers:

2

In a Pascal program, what does statement s1:=[0,3,7] mean ?

+3  A: 

s1 is a Pascal set variable, and it is being initialised so that the set contains the members 0, 3 and 7.

Paul R
thank you Paul :))
osabri
+1  A: 

Pascal has first-class support for sets. s1 is presumably declared as a set, like

var  s1 : set of 0..10;

You can then write

if i in s1
// true when i is 0, 3 or 7
mdma