In this article, we will learn how to write a swift program to get the denominator from the rational number. A rational number is a number, which represents in the form of n/m where m is not equal to zero. Here n is known as the numerator and m is known as the denominator. For example, 2/3, 11/19, etc. Here, 2 and 11 are numerators whereas 3 and 19 are denominators. Algorithm Step 1 − Create a structure to create a rational number. Step 2 − In this structure, create two properties of integer type to store the numerator and ... Read More
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 map(_:) method Using = operator Using append(contentsOf:) method Method 1: Using map(_:) method The map(_:) method is used to return an array that contains the result of mapping the given closure over the specified sequence’s elements. Syntax func map(_mclosure:(Self.Element) throws - >T)rethrows [T] Here, mclouser is a mapping ... Read More
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 given number. For example − Number = 123 Sum = 1 + 2 + 3 = 6 Product = 1 * 2 * 3 = 6 Hence 123 is a spy number because sum = product Number = 23 Sum = 2 + 3 = 5 Product = 2 * ... Read More
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 & 0 & 0 & 0ewline0 & 1 & 0 & 0 ewline0 & 0 & 1 & 0 ewline0 & 0 & 0 & 1\end{bmatrix}}$ Whereas a square matrix is a matrix in which the number of rows is equal to number of columns and it may or may not ... Read More
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 at a01, and so on. Therefore, to add two matrices we are going to use + operator to add the elements of two matrices like a00 + b00 and then store the sum into a new matrix. For example: Matrix 1 − $\mathrm{\begin{bmatrix}2 & 3 & 4 ewline5 & 2 ... Read More
Generally, when we need to edit multiple cells very frequently, we will be selecting the cells using the ctrl command and clicking on delete, but sometimes it can be a problem when we select different cells or when we miss selecting some cells. We can solve this problem by following the process mentioned in this article. This article will help you understand how we can apply a button to clear specific cells in Excel. This process has two parts: creating a button and assigning a macro to the button. Applying a Button to Clear Specific Cells in Excel Here we ... Read More
Consider the following scenario: we want to combine the text of multiple cells into a single cell. This is a very simple and commonly used method in Excel in order to perform activities in our day-to-day life usage of the program. This can be accomplished in two ways: by using the concatenation function or by inserting the "&" symbol between the cells. Read this tutorial to learn a simple process to add text from one cell to another in Excel. Appending Text from One Cell to Another using Concat Here we will use the CONCAT formula to get any one ... Read More
When we conduct any surveys and collect the information and store it in Excel, it can be a very complex problem to analyse it manually, but by following this simple process, we can analyse the data present in the Excel sheet. This process mainly contains three steps: first, count the number of different opinions, then calculate the percentage of each result, and finally, create the survey report. This tutorial will help you understand how we can analyze the survey data in Excel. Analyzing Survey Data in Excel Here we will first find the number of blank cells and then calculate ... Read More
When we are working with multiple sheets in Excel, we can see that when we open the workbook, it will always start from the sheet where we last saved. This can lead to some privacy issues in Excel. Sometimes you don’t want that to happen, and you want to open a specific worksheet in the workbook. This tutorial will help you understand how we can always start the same worksheet when opening the same workbook. Always Start the Same Worksheet When Opening a Workbook Here we will insert VBA code and then save the code to complete the task. Let ... Read More
When we are using a drop-down list in Excel, the arrow mark of the drop-down list will only appear if we click on any cell of the list. This creates a problem when we are using multiple drop-down lists in a single column. We can solve this problem by adding a persistent arrow mark to the cell in Excel. This tutorial will help you understand how we can show the arrow of a data validation list in Excel. Showing the Arrow of Data Validation List in Excel Here we will first use the data validation list and then inset an ... Read More