Swift Program To Create A Simple Set Collection

You are currently viewing Swift Program To Create A Simple Set Collection

Swift Program To Create A Simple Set Collection

// Swift program to create 
// a simple set collection.

import Swift

let IntegerSet:Set = [10, 20, 30, 40,50]

print("Set elements:")
for num in IntegerSet {
    print(num)
}

Output

Set elements:
50
20
30
40
10

...Program finished with exit code 0
Press ENTER to exit console.

Ranjith

Hi, I'm Manoj a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply