Found 33676 Articles for Programming

Swift Program to Print Alphabetic Inverted Pattern

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

236 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

227 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

573 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

1K+ 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

2K+ 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

2K+ 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

1K+ 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

Swift Program to convert Decimal to Octal

Ankita Saini
Updated on 30-Nov-2022 06:07:46

447 Views

This tutorial will discuss how to write Swift program to convert Decimal to Octal. 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. Octal numbers are those numbers whose base value is 8. Octal numbers are also known as base 8 number system which contain 8 numbers: 0, 1, 2, 3, 4, 5, 6, 7. Here, the position ... Read More

How to Sort Elements in Lexicographical Order (Dictionary Order) in Golang?

Aman Sharma
Updated on 29-Nov-2022 07:52:53

2K+ Views

In this tutorial, we will write the Golang program to sort the elements in lexicographical order. The tutorial will include three different ways to do this thing. To do the sorting we need to compare two strings and for that, we will use the < operator it will return a boolean value. If the value on the left side is greater than the right side value lexicographically then it will return false else true. For example, Tutorial < Point - The operator will return true. C++ < Golang - The operator will return false. Algorithm Step 1 − Create and ... Read More

How To Perform nCr (r-combinations) in Golang?

Aman Sharma
Updated on 29-Nov-2022 07:50:29

591 Views

In this tutorial, we will perform nCr(r-combinations) in the Golang programming language. The use case of nCr(r-combinations) is to find the total number of possible arrangements where the order does not matter. In other words, we are selecting the r items from n items where the order does not matter. This tutorial will include two ways to find this in the Golang programming language. Explanation For example, for n =5 and r = 3 nCr = n! / ( r! * ( n - r )! ) = 5! / ( 3! * 2! ) = 120 / ... Read More

Advertisements