Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles on Trending Technologies
Technical articles with clear explanations and examples
Swift Program to initialize and print a complex number
In this article, we will learn how to write a swift program to initialize and print complex numbers. Complex numbers are those numbers which express in the form of x+yi, where x and y are real numbers and ‘i’ is an imaginary number known as iota. Alternatively, we can say that a complex number is a combination of both real and imaginary numbers. For example 1+2i, 1-3i, etc. In Swift, we use a struct to create complex numbers. Algorithm Step 1 − Create a structure using the struct keyword. Step 2 − In this structure, create two properties ...
Read MoreSwift Program to get the imaginary part of the given complex number
In this article, we will learn how to write a swift program to get the imaginary part of the given complex number. Complex numbers are those number which express in the form of x+yi, where x and y are real numbers and ‘i’ is an imaginary number known as iota. For example: 1+2i, 1-3i, etc. Here we use the following methods to get imaginary part − Using function Without using function Method 1: Using function To get the imaginary part of the complex number we create a function which takes struct object as a parameter and return the ...
Read MoreSwift Program to get the denominator from a rational number
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 MoreSwift Program to Copy All the Elements of One Array to Another Array
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 MoreSwift Program to Check If a Number is Spy number or not
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 MoreSwift program to check if a given square matrix is an Identity Matrix
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 MoreSwift Program to Add Two Matrix Using Multi-dimensional Arrays
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 MoreHow to Apply a Button to Clear Specific Cells in Excel?
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 MoreHow to Append Text from One Cell to Another in Excel?
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 MoreHow to Analyze Survey Data in Excel?
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