Ankita Saini has Published 319 Articles

Swift Program to fill an array with a specific element

Ankita Saini

Ankita Saini

Updated on 27-Jan-2023 12:28:31

1K+ Views

In this article, we will learn how to write a swift program to fill an array with a specific element. An array is used to store elements of same data type in an order whereas a set is used to store distinct elements of same data type without any definite ... Read More

Swift Program to find the prime numbers from the array

Ankita Saini

Ankita Saini

Updated on 17-Jan-2023 17:40:27

2K+ Views

In this article, we will learn how to write a swift program to find the prime numbers from the array. Prime numbers are those numbers that are only divisible by 1 and itself. Or we can say prime number have only two factors that are 1 and the number itself. ... Read More

Swift Program to remove all 'nil' elements from the array

Ankita Saini

Ankita Saini

Updated on 17-Jan-2023 17:36:39

1K+ Views

In this article, we will learn how to write a swift program to remove all ‘nil’ elements from the array. Till now we all know that an array can store elements of a single data type. But Swift array can also hold elements of multiple data types. To store ... Read More

Swift Program to find the EVEN numbers from the array

Ankita Saini

Ankita Saini

Updated on 17-Jan-2023 17:20:51

2K+ Views

In this article, we will learn how to write a swift program to find even numbers from the array. Even number are those number which are completely divisible by 2. For example, 2, 6, 50, 20, etc. Here we use the following methods to find the even numbers from ... Read More

Swift Program to fetch elements from an array based on an index

Ankita Saini

Ankita Saini

Updated on 17-Jan-2023 17:15:02

449 Views

In this article, we will learn how to write a swift program to fetch elements from an array based on an index. Using array syntax An array is used to store elements of same data type in an order whereas a set is used to store distinct elements of same ... Read More

Swift Program to Convert Set of String to Array of String

Ankita Saini

Ankita Saini

Updated on 17-Jan-2023 17:13:20

2K+ Views

In this article, we will learn how to write a swift program to convert set of string to array of string. An array is used to store elements of same data type in an order whereas a set is used to store distinct elements of same data type without any ... Read More

Swift Program to append an element into an array

Ankita Saini

Ankita Saini

Updated on 17-Jan-2023 17:09:25

1K+ Views

In this article, we will learn how to write a swift program to append an element into an array. An array is used to store elements of same data type in an order whereas a set is used to store distinct elements of same data type without any definite order. ... Read More

Swift Program to Subtract Two Matrix Using Multi-dimensional Arrays

Ankita Saini

Ankita Saini

Updated on 09-Jan-2023 15:22:58

357 Views

In this article, we will learn how to write a swift program to subtract two matrices using multi-dimensional arrays. A matrix is a mathematical structure in which the elements are placed in rows and columns format. For example, the first element is present at a00 location, the second at a01, ... Read More

Swift Program to Search an Element in an Array

Ankita Saini

Ankita Saini

Updated on 09-Jan-2023 15:19:47

1K+ Views

In this article, we will learn how to write a swift program to search an element in an Array. Here we use the following methods to search elements from the given array: To search Using == operator Using contains() method Using the in function Method 1: Using ... Read More

Swift Program to Remove Duplicate Elements From an Array

Ankita Saini

Ankita Saini

Updated on 09-Jan-2023 15:17:44

9K+ Views

In this article, we will learn how to write a swift program to remove duplicate elements from an array. As we know that an array can store multiple elements of the same type. It is not necessary that all the elements are unique they can be duplicated. For example, arr ... Read More

Advertisements