Ankita Saini has Published 319 Articles

Swift Program to Copy All the Elements of One Array to Another Array

Ankita Saini

Ankita Saini

Updated on 09-Jan-2023 14:44:28

3K+ Views

In this article, we will learn how to write a swift program to copy all the elements of one array to another array. Swift doesn’t provide a direct method to copy the elements of one array to another but we can do this using the following methods − Using ... Read More

Swift Program to Check If a Number is Spy number or not

Ankita Saini

Ankita Saini

Updated on 09-Jan-2023 14:40:19

347 Views

In this article, we will learn how to write a swift program to check if a number is a spy number or not. A spy number is a number in which the sum of the digits of the given number is equal to the product of the digits of the ... Read More

Swift program to check if a given square matrix is an Identity Matrix

Ankita Saini

Ankita Saini

Updated on 09-Jan-2023 14:36:29

159 Views

In this article, we will learn how to write a swift program to check if a given square matrix is the identity matrix. The identity matrix is an MxM square matrix in which the main diagonal consists of ones and other elements are all zero. For example − $\mathrm{M\:=\:\begin{bmatrix}1 & ... Read More

Swift Program to Add Two Matrix Using Multi-dimensional Arrays

Ankita Saini

Ankita Saini

Updated on 09-Jan-2023 14:34:18

335 Views

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

Swift Program to Calculate Standard Deviation

Ankita Saini

Ankita Saini

Updated on 29-Dec-2022 17:24:40

438 Views

In this article, we will learn how to write a swift program to calculate standard deviation. Standard deviation is a measure, which will represent how much variation from the mean exists, or we can say that it is used to calculate the extent to which the values are differ from ... Read More

Swift Program to Check Whether Two Matrices Are Equal or Not

Ankita Saini

Ankita Saini

Updated on 29-Dec-2022 17:24:11

120 Views

In this article, we will learn how to write a swift program to check whether two matrices are equal or not. Here, we create two matrices, and using the not equal to the operator (!=), we check whether all the elements of both matrices are equal or not. Algorithm ... Read More

Swift Program to Compute the Sum of Diagonals of a Matrix

Ankita Saini

Ankita Saini

Updated on 29-Dec-2022 17:23:41

541 Views

In this article, we will learn how to write a swift program to compute the sum of diagonals of a matrix. Every matrix has two diagonals which are known as primary and secondary diagonals. For example, we have the following 5x5 square matrix − 2 3 4 5 6 4 ... Read More

Swift Program to Display Upper Triangular Matrix

Ankita Saini

Ankita Saini

Updated on 29-Dec-2022 17:23:06

120 Views

In this article, we will learn how to write a swift program to display upper triangular matrix. Upper triangular matrix is a matrix in which all the elements below the primary diagonal are zero. As shown in the below image − $$\mathrm{\begin{bmatrix} 1 & 4 & 6 & 7 & ... Read More

Swift Program to Find the Sum of the Boundary Elements of a Matrix

Ankita Saini

Ankita Saini

Updated on 29-Dec-2022 17:22:34

95 Views

In this article, we will learn how to write a swift program to find the sum of the boundary elements of a matrix. Boundary elements of a matrix are those elements that are present on the boundary of the matrix that are elements in the first row, last row, first ... Read More

Swift Program to Find the Trace and Normal of a given Matrix

Ankita Saini

Ankita Saini

Updated on 29-Dec-2022 17:21:58

84 Views

In this article, we will learn how to write a swift program to find trace and normal of a given matrix. Calculating the Trace of a given Matrix Trace is known as the sum of primary diagonal elements of the given square matrix. For example, we have a 3x3 square ... Read More

Advertisements