Found 517 Articles for Swift

Swift Program to Print Upper Binary Triangle Pattern

Ankita Saini
Updated on 30-Nov-2022 06:30:32

165 Views

This tutorial will discuss how to write swift program to print upper star triangle pattern. Binary pattern is a sequence of “0” and “1” which is used to develop different patterns or shapes like pyramid, rectangle, cross, etc. To create a upper binary right triangle pattern we can use any of the following methods − Using nested for loop Using init() Function Using stride Function Below is a demonstration of the same − Input Suppose our given input is − Num = 3 Output The desired output would be − 1 1 0 1 0 ... Read More

Swift Program to Print Binary Right Triangle Pattern

Ankita Saini
Updated on 30-Nov-2022 06:25:32

146 Views

This tutorial will discuss how to write swift program to print Binary Right triangle pattern. Binary pattern is a sequence of “0” and “1” which is used to develop different patterns or shapes like pyramid, rectangle, cross, etc. To create a binary right triangle pattern we can use any of the following methods − Using nested for loop Using init() Function Using stride Function Below is a demonstration of the same − Input Suppose our given input is − Num = 4 Output The desired output would be − 1 1 0 1 0 1 ... Read More

Swift Program to Print Reverse Pyramid Alphabetic Pattern

Ankita Saini
Updated on 30-Nov-2022 06:24:14

231 Views

This tutorial will discuss how to write swift program to print reverse pyramid alphabetic pattern. Alphabetic pattern is a sequence of alphabets starting from A to Z which is used to develop different patterns or shapes like pyramid, rectangle, cross, etc of alphabets. To create an alphabetic inverted pattern, we can use any of the following methods − Using nested for loop Using init() Function Using stride Function Below is a demonstration of the same − Input Suppose our given input is − Range = A to E Output The desired output would be − A B C D ... Read More

Swift Program to Print Alphabetic Inverted Pattern

Ankita Saini
Updated on 30-Nov-2022 06:22:34

142 Views

This tutorial will discuss how to write swift program to print alphabetic inverted pattern. Alphabetic pattern is a sequence of alphabets starting from A to Z which is used to develop different patterns or shapes like pyramid, rectangle, cross, etc of alphabets. To create a alphabetic inverted pattern we can use any of the following methods − Using nested for loop Using init() Function Using stride Function Below is a demonstration of the same − Input Suppose our given input is − Range = A to E Output The desired output would be − A B C D E ... Read More

Swift Program to Print Alphabetic Solid Square Pattern

Ankita Saini
Updated on 30-Nov-2022 06:21:10

152 Views

This tutorial will discuss how to write swift program to print alphabetic solid square pattern. Alphabetic pattern is a sequence of alphabets starting from A to Z which is used to develop different patterns or shapes like pyramid, rectangle, cross, etc of alphabets. To create a alphabetic solid square pattern we can use any of the following methods − Using nested for loop Using init() Function Using stride Function Below is a demonstration of the same − Input Suppose our given input is − Length = A to D Output The desired output would be − A ... Read More

Swift Program to Print Alphabetic Right Triangle Pattern

Ankita Saini
Updated on 30-Nov-2022 06:19:15

379 Views

This tutorial will discuss how to write swift program to print alphabetic right triangle pattern. Alphabetic pattern is a sequence of alphabets starting from A to Z which is used to develop different patterns or shapes like pyramid, rectangle, cross, etc of alphabets. To create a alphabetic right triangle pattern we can use any of the following methods − Using nested for loop Using init() Function Using stride Function Below is a demonstration of the same − Input Suppose our given input is − Length = A to D Output The desired output would be − A ... Read More

Swift Program to convert Binary to Decimal

Ankita Saini
Updated on 30-Nov-2022 06:16:01

789 Views

This tutorial will discuss how to write Swift program to convert Binary to Decimal number. Decimal numbers are those numbers whose base value is 10. Decimal numbers are also known as base-10 number system which contain 10 numbers: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. Here, the position of every digit in the decimal number has weight is a power of 10. For example, (89)10 = 8 x 101 + 9 x 100. Binary numbers are those numbers whose base value is 2. Binary numbers are also known as base-16 number system which contain only two number ... Read More

Swift Program to convert Decimal to Binary

Ankita Saini
Updated on 30-Nov-2022 06:14:20

1K+ Views

This tutorial will discuss how to write Swift program to convert Decimal to Binary number. Decimal numbers are those numbers whose base value is 10. Decimal numbers are also known as base-10 number system which contain 10 numbers: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. Here, the position of every digit in the decimal number has weight is a power of 10. For example, (89)10 = 8 x 101 + 9 x 100. Binary numbers are those numbers whose base value is 2. Binary numbers are also known as base-16 number system which contain only two number ... Read More

Swift Program to convert Decimal to Hexadecimal

Ankita Saini
Updated on 30-Nov-2022 06:12:58

1K+ Views

This tutorial will discuss how to write Swift program to convert Decimal to Hexadecimal number. Decimal numbers are those numbers whose base value is 10. Decimal numbers are also known as base-10 number system which contain 10 numbers: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. Here, the position of every digit in the decimal number has weight is a power of 10. For example, (89)10 = 8 x 101 + 9 x 100. Hexadecimal numbers are those numbers whose base value is 16. Hexadecimal numbers are also known as base-16 number system which contain 16 symbols: 0, ... Read More

Swift Program to convert Hexadecimal to Decimal

Ankita Saini
Updated on 30-Nov-2022 06:10:56

828 Views

This tutorial will discuss how to write Swift program to convert Hexadecimal to Decimal. Decimal numbers are those numbers whose base value is 10. Decimal numbers are also known as base-10 number system which contain 10 numbers: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. Here, the position of every digit in the decimal number has weight is a power of 10. Hexadecimal numbers are those numbers whose base value is 16. Hexadecimal numbers are also known as base-16 number system which contain 16 symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, ... Read More

Advertisements