Ankita Saini has Published 319 Articles

How to Calculate the Value of nPr in Swift?

Ankita Saini

Ankita Saini

Updated on 08-Sep-2023 18:37:42

63 Views

nPr is known as n permutation r, where n represents the total numbers and r represents the arrangement of the elements. A permutation is known as the arrangement of elements in a specified order. Elements can arrange either in a sequence or in a linear order, for example, we have ... Read More

Tech number in Swift

Ankita Saini

Ankita Saini

Updated on 08-Sep-2023 15:59:09

72 Views

If the given number contains an even number of digits and the digits of the number can be divided into two equal parts from the middle. After dividing the digits sum up the divided digits and find the square of the final sum. If the square is equal to the ... Read More

Swift Program to Print Floyd’s Triangle

Ankita Saini

Ankita Saini

Updated on 08-Sep-2023 15:56:06

109 Views

Floyd triangle is right angle triangled which is named after Rober Floyd. It is created with the help of natural numbers starting from 1 in the top left corner and then the consecutive numbers are filled in the specified rows. Example Demonstration Input 4 Output 1 ... Read More

How to Write Calculator Program using Switch Case in Swift

Ankita Saini

Ankita Saini

Updated on 08-Sep-2023 15:51:06

326 Views

A Calculator is an electronic device which is used to perform different types of mathematical operations like subtraction, addition, division, multiplication, etc. We can also create a calculator using Switch case and simple arithmetic operations in Swift programming. It will also perform the same mathematical operations as the original calculator. ... Read More

How to Swap Pair of Characters in Swift?

Ankita Saini

Ankita Saini

Updated on 08-Sep-2023 15:35:03

157 Views

Swapping pair of characters is a process of interchanging the position of two characters in the given string. This operation is commonly used in various programming languages and applications to manipulate data. Example Input “mumbai” Output umbmia Input “Prita” Output rPtia Here, ... Read More

How to Calculate the Volume of a Tetrahedron in Swift?

Ankita Saini

Ankita Saini

Updated on 08-Sep-2023 15:30:27

52 Views

Tetrahedron is a triangular base pyramid. It is a platonic solid with four triangular faces, six straight edges and four vertex corners. Where each vertex is connected with every other vertex and each face is of an equilateral triangle. In Swift, we can calculate the volume of a tetrahedron ... Read More

How to Calculate the Area of a Tetrahedron in Swift?

Ankita Saini

Ankita Saini

Updated on 08-Sep-2023 15:04:47

38 Views

Tetrahedron is a 3−D triangular pyramid shape whose base is also a triangle. Generally, a tetrahedron contains four equilateral triangles, hence it has interior angles of 60 degrees. In Swift, we can calculate the area of a tetrahedron using the following formula: Formula $$\mathrm{Area=\sqrt{3}*X*X}$$ Here, x represents the side ... Read More

Swift Program to calculate the sum of left diagonal of the matrix

Ankita Saini

Ankita Saini

Updated on 19-Jul-2023 14:26:19

102 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. So here we calculate the sum of the left diagonal of the square matrix using Swift Programming. A square matrix is a matrix in which ... Read More

Swift Program to calculate the sum of right diagonal of the matrix

Ankita Saini

Ankita Saini

Updated on 19-Jul-2023 14:23:32

181 Views

A matrix is an arrangement of numbers in rows and columns. A matrix has two diagonals i.e. Right diagonal and Left diagonal. So here we calculate the sum of the right diagonal of the square matrix using Swift Programming. For example, we have the following matrix − Matrix = 3 ... Read More

Swift Program to Check if a String is Numeric

Ankita Saini

Ankita Saini

Updated on 19-Jul-2023 14:22:07

1K+ Views

To check if the given string is numeric or not we use Double() initializer in Swift Programming. A string is an ordered collection of characters for example “Sky”. A string can be numeric and non-numeric. A numeric string is a string which only contains numbers for example “12345”. So the ... Read More

1 2 3 4 5 ... 32 Next
Advertisements