Programming Articles

Page 1969 of 2547

Swift Program to convert Binary to Decimal

Ankita Saini
Ankita Saini
Updated on 30-Nov-2022 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
Ankita Saini
Updated on 30-Nov-2022 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
Ankita Saini
Updated on 30-Nov-2022 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
Ankita Saini
Updated on 30-Nov-2022 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
Ankita Saini
Updated on 30-Nov-2022 547 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
Aman Sharma
Updated on 29-Nov-2022 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
Aman Sharma
Updated on 29-Nov-2022 719 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

How to find the Surface area and Volume of Cuboid in Golang?

Aman Sharma
Aman Sharma
Updated on 29-Nov-2022 272 Views

In this tutorial, we will see the Golang program to find the Surface Area and Volume of a Cuboid. The area is the total space covered by any closed figure. The volume is the capacity to hold something inside the vessel. Formula l - length of a Cuboid h - the height of a Cuboid w - width of a Cuboid. Surface Area of Cuboid - 2*l*w + 2*w*h + 2*l*h For example, the length of a Cuboid is 10 cm, the height is 5 cm and, the width is 8 cm so the Surface Area of a ...

Read More

How to find the Arc Tangent of a given value in Golang?

Aman Sharma
Aman Sharma
Updated on 29-Nov-2022 254 Views

In this tutorial, we will learn how to find the Arc Tangent of a given value in the Golang programming Language. Golang language has many packages with predefined functions that the developer can use without writing the complete logic To perform the mathematical operations and logic we have a math package in Golang. We will use this package only to find the Arc Tangent of a given value. We will also see how to import the package and also how to call a function this package consists of by writing a Golang code. Arc Tangent Definition Arc Tangent is a ...

Read More

How to find the Arc Sine of a given value in Golang?

Aman Sharma
Aman Sharma
Updated on 29-Nov-2022 254 Views

In this tutorial, we will learn how to find the Arc Sine of a given value in the Golang programming Language. Golang language has many packages with predefined functions that the developer can use without writing the complete logic. To perform the mathematical operations and logic we have a math package in Golang. We will use this package only to find the Arc Sine of a given value. We will also see how to import the package and also how to call a function this package consists of by writing a Golang code. Arc Sine Definition Arc Sine is ...

Read More
Showing 19681–19690 of 25,466 articles
Advertisements