Swift Program to Print the Length of the Array

You are currently viewing Swift Program to Print the Length of the Array

Swift program to print the length of the array

// Swift program to print the length of the array

import Swift

var arr:[Int] = [10,20,30,40,50]

var length = arr.count

print("Length of array: ",length)

output

Length of array:  5

...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