Swift Program to Access the Value of an Array Using ‘For In’ Loop

Swift program to access the value of an array using ‘for in’ loop

// Swift program to access the value of
// an array using the "for in" loop

import Swift;

let countries = ["INDIA", "USA", "UK", "CANADA"]

for country in countries {
    print(country);
}

Output

INDIA
USA
UK
CANADA

...Program finished with exit code 0
Press ENTER to exit console.
Share on:

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

Leave a Comment