Ankita Saini has Published 319 Articles

Swift Program to calculate the sum of rows of matrix elements

Ankita Saini

Ankita Saini

Updated on 16-Feb-2023 16:40:50

291 Views

A matrix is an arrangement of numbers in rows and columns. Matrix can be of various type like square matrix, horizontal matrix, vertical matrix etc.In this article, we will learn how to write a swift program to calculate the sum of rows of matrix elements. Here we are using the ... Read More

Swift Program to Calculate the Sum of Matrix Elements

Ankita Saini

Ankita Saini

Updated on 16-Feb-2023 16:39:09

292 Views

A matrix is a rectangular array of numbers. Or we can say that a matrix is an arrangement of numbers in rows and columns. Matrix can be of various type like square matrix, horizontal matrix, vertical matrix etc. In this article, we will learn how to write a swift ... Read More

Swift Program to calculate the sum of columns of matrix elements

Ankita Saini

Ankita Saini

Updated on 16-Feb-2023 16:38:01

607 Views

A matrix is an arrangement of numbers in rows and columns. The matrix can be of various types like square, horizontal, vertical, etc. In this article, we will learn how to write a swift program to calculate the sum of columns of matrix elements. Here we are using the following ... Read More

Swift program to check if string is pangram or not

Ankita Saini

Ankita Saini

Updated on 08-Feb-2023 21:14:22

610 Views

Pangram string is a string that contains all the English alphabet. For example − String = “The quick brown fox jumps over the lazy dog” Here the string is a pangram string which contains all the alphabetical characters from a to z in it. String = “ Hello! Swati how ... Read More

Swift Program to check whether a given string is Heterogram or not

Ankita Saini

Ankita Saini

Updated on 08-Feb-2023 21:13:54

261 Views

Heterogram string is a string in which no alphabet occurs more than once. For example, “Sky with cloud” is a heterogram because in the string each alphabet occurred only once. Whereas “colorful balloons” is not a Heterogram because in the string some alphabet like o, u, l, etc appears more ... Read More

Swift Program to check if a given string is Keyword or not

Ankita Saini

Ankita Saini

Updated on 08-Feb-2023 20:21:51

337 Views

Keywords are reserved words used to perform some internal process or represent predefined actions. It is not allowed to use these keywords as a variable name, constant name, or identifier. Swift support approx 101 keywords. For example, ‘var’ is a keyword but ‘hey’ is not a keyword. Here, we ... Read More

Swift Program to check if an Array is Palindrome or not

Ankita Saini

Ankita Saini

Updated on 08-Feb-2023 20:20:39

3K+ Views

A palindrome array is an array that remains the same when its elements are reversed we can also say that the elements of a palindrome array remain the same even if we read it from backward or forward. For example, [1, 9, 10, 9, 1] is a palindrome array whereas ... Read More

Swift Program to Convert Array to Set

Ankita Saini

Ankita Saini

Updated on 08-Feb-2023 20:19:03

9K+ Views

An array is used to store elements of the same data type in an order whereas a set is used to store distinct elements of the same data type without any definite order. To convert Array into set we use Set() initialiser. The resultant set contains the same elements as ... Read More

Swift Program to find the 1's complement of the given number

Ankita Saini

Ankita Saini

Updated on 08-Feb-2023 20:17:46

766 Views

1’s complement of a binary number is the invert of the given number. For example, we have a number = 10101011, so the one’s complement is 01010100. Here we using the following two methods to find one’s complement − Replacing 1s with 0s and 0s with 1s Using XOR In ... Read More

Swift Program to find the given number is strong or not

Ankita Saini

Ankita Saini

Updated on 08-Feb-2023 20:16:57

253 Views

A strong number is a special number in which the sum of the factorial of its digit is equal to the number itself. For example − Number = 345 345! = 3! + 4! + 5! = 6 + 24 + 120 = 150 Here 345 is not a strong ... Read More

Advertisements