- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 517 Articles for Swift
![Ankita Saini](https://www.tutorialspoint.com/assets/profiles/489852/profile/60_2374666-1658225115.jpg)
3K+ Views
This tutorial will discuss how to write swift program to sort a Dictionary. A dictionary is used to store data in the form of key-value pair in the collation without any defined-order. Here the type of the keys are same as well as the type of the values are also same. Each key is behave like an identifier for the associate value inside the dictionary and each value has a unique key. Swift dictionary is just like the real dictionary. It loop up values according to their identifier. Syntax Following is the syntax for creating dictionary − ... Read More
![Ankita Saini](https://www.tutorialspoint.com/assets/profiles/489852/profile/60_2374666-1658225115.jpg)
1K+ Views
This tutorial will discuss how to write swift program to check the dictionary is empty. A dictionary is used to store data in the form of key-value pair in the collation without any defined-order. Here the type of the keys are same as well as the type of the values are also same. Each key is behave like an identifier for the associate value inside the dictionary and each value has a unique key. Swift dictionary is just like the real dictionary. It loop up values according to their identifier. Syntax Following is the syntax for creating dictionary − var ... Read More
![Ankita Saini](https://www.tutorialspoint.com/assets/profiles/489852/profile/60_2374666-1658225115.jpg)
764 Views
This tutorial will discuss how to write swift program to find the size of dictionary. A dictionary is used to store data in the form of key-value pair in the collation without any defined-order. Here the type of the keys are same as well as the type of the values are also same. Each key is behave like an identifier for the associate value inside the dictionary and each value has a unique key. Swift dictionary is just like the real dictionary. It loop up values according to their identifier. Syntax Following is the syntax for creating dictionary − var ... Read More
![Ankita Saini](https://www.tutorialspoint.com/assets/profiles/489852/profile/60_2374666-1658225115.jpg)
264 Views
This tutorial will discuss how to write Swift program to display Armstrong numbers between intervals using function The sum of nth power of individual digit of a number is equal to the number itself, then such type of number is known as Armstrong number. Suppose we have a number 407 so here n = 3 407 = 43 + 03 + 73 407 = 64 + 0 +343 407 = 407 Hence 407 is Armstrong number Suppose we have another number 2346, so here n = 4 2346 = 24 + 34 + 44 + 64 2346 = 16 + ... Read More
![Ankita Saini](https://www.tutorialspoint.com/assets/profiles/489852/profile/60_2374666-1658225115.jpg)
993 Views
This tutorial will discuss how to write swift program to check Armstrong number. The sum of nth power of individual digit of a number is equal to the number itself, then such type of number is known as Armstrong number. Suppose we have a number 407 so here n = 3 153 = 13 + 53 + 33 153 = 1 + 125 + 27 153 = 153 Hence 153 is Armstrong number Suppose we have another number 8973, so here n = 4 8973 = 84 + 94 + 74 + 34 8973 = 4096 + 6561 + 2401 ... Read More
![Ankita Saini](https://www.tutorialspoint.com/assets/profiles/489852/profile/60_2374666-1658225115.jpg)
310 Views
This tutorial will discuss how to write swift program to display Armstrong number between two intervals. The sum of nth power of individual digit of a number is equal to the number itself, then such type of number is known as Armstrong number. Suppose we have a number 407 so here n = 3 407 = 43 + 03 + 73 407 = 64 + 0 +343 407 =407 Hence 407 is Armstrong number Suppose we have another number 2346, so here n = 4 2346 = 24 + 34 + 44 + 64 2346 = 16 + 81 + ... Read More
![Ankita Saini](https://www.tutorialspoint.com/assets/profiles/489852/profile/60_2374666-1658225115.jpg)
220 Views
This tutorial will discuss how to write swift program to find the geometric mean of the numbers. Geometric mean also known as GM. Geometric mean is defined as the xth root of the product of x numbers. Suppose we have x elements(that are, a1, a2, a3, ....ax) in the given array, then the geometric mean is − GM = (a1 * a2 * a3 * a4 * ....*ax)1/x Below is a demonstration of the same − Input Suppose our given input is − MyVal = [34, 67, 2, 45, 8, 12] Output The desired output would be − Geometric ... Read More
![Ankita Saini](https://www.tutorialspoint.com/assets/profiles/489852/profile/60_2374666-1658225115.jpg)
208 Views
This tutorial will discuss how to write swift program to find the harmonic mean of the numbers. Harmonic mean also known as HM is defined as the reciprocal of the average of reciprocal. Or we can say that harmonic mean is the reciprocal of the arithmetic mean by their reciprocal. Suppose a1, a2, a3, a4, .....an are the n-elements of a collection then the harmonic means is − HM = n/[(1/a1) + 1/(a2) + 1/(a3) + 1/(a4)+...+ 1/(an)] Below is a demonstration of the same − Input Suppose our given input is − MyVal = [3.4, 1.2, 7.8, 4.5, 2.4] ... Read More
![Ankita Saini](https://www.tutorialspoint.com/assets/profiles/489852/profile/60_2374666-1658225115.jpg)
832 Views
This tutorial will discuss how to write swift program to find median of an unsorted array. An array is an ordered collection which is used to store same type of data. For example, if any array is of integer type then it will only store integers, you are strictly not allowed to store elements of other data types like string, float, etc. Syntax Following is the syntax for an array − var array1 = [val1, val2, val3, …] Or var array2 = [Type]() Median represent the middle value of the given sorted set of numbers. We can calculate the ... Read More
![Ankita Saini](https://www.tutorialspoint.com/assets/profiles/489852/profile/60_2374666-1658225115.jpg)
180 Views
This tutorial will discuss how to write swift program to find mean of an unsorted array. An array is an ordered collection which is used to store same type of data. For example, if any array is of integer type then it will only store integers, you are strictly not allowed to store elements of other data types like string, float, etc. Syntax Following is the syntax for an array − var array1 = [val1, val2, val3, …] Or var array2 = [Type]() Mean represent the average of the given numbers. It is calculated by dividing the sum of ... Read More