In this article we will discuss about how to get total bits required for the given number using library function in Go language. To get the total number of bits of any number we need to represent that number in binary which is a combination of zeroes and ones and then count the number of zeroes and ones. For example: 16 can be converted in binary as 10000 and therefore number of bits in number 16 are 5. 65 can be converted in binary as 1000001 and therefore number of bits in number 65 are 7. Syntax Functions − func ... Read More
In this article we will discuss about how to get the remainder of float numbers using library function in Go language. In programming, a float is a number that has a decimal point in it. For example: 0.2, 5.89, 20.79, etc. Remainder: Remainder in division is defined as the result left after the division process is over. For example, if 4 is the dividend and 2 is the divisor then after dividing 4 with 2 the remainder will be 0. Similarly on dividing 4 with 3 the remainder will be 1. To get the remainder of floating values we can ... Read More
In this article we will discuss about how to get the quotient and remainder in GO language using library function. Syntax func Div(a, b, c uint) (q, r uint) func Remainder(q, r float64) float64 The div() function accepts three arguments as unsigned integers and returns the quotient and remainder respectively after computing the division process. The remainder() function accepts two arguments as 64-bit float values and returns the remainder after performing the division process in the same format. The source code to get the quotient and remainder of division using library functions is compiled and executed below. Finding The ... Read More
In this tutorial, we are going to learn how to find the sum of N Numbers using Recursion in Golang programming language. A Recursion is where a function calls itself by direct or indirect means. Every recursive function has a base case or base condition which is the final executable statement in recursion and halts further calls. Below are two examples showing the two different type of recursion: direct and indirect. Find the Sum of N Numbers by Direct Recursion Method Syntax Syntax for direct recursion func recursion() { recursion() } func main() { ... Read More
In this tutorial, we are going to learn how to find the sum of Natural Numbers using Recursion in Golang. A Recursion is where a function calls itself by direct or indirect means. Every recursive function has a base case or base condition which is the final executable statement in recursion and halts further calls. Below are two examples showing the two different type of recursion: direct and indirect. Find the Sum of Natural numbers by Direct Recursion Method Syntax func recursion() { recursion() } func main() { recursion(); } Algorithm Step ... Read More
In this tutorial, we will learn how to reverse a sentence using recursion in Go Programming Language. A Recursion is where a function calls itself by direct or indirect means. Every recursive function has a base case or base condition which is the final executable statement in recursion and halts further calls. The recursion continues until some condition is met to prevent it. Below are two examples showing the two different type of recursion: direct and indirect. Reverse a Sentence using Recursion by using Direct Recursion Method Syntax Func recursion() { recursion(); /* function calls itself */ ... Read More
In this tutorial we will learn how to create a function without argument and without a return value in Go Programming Language. When a function has no arguments, it does not receive any data from the calling function. Similarly when it does not return any value, the calling function does not receive any data from the called function. So there is no data transfer between calling and called function. Add two Numbers Algorithm Step 1 − Import the package fmt package Step 2 − Start function main () Step 3 − Calling the function add () Step 4 − ... Read More
In this tutorial we will discuss how to write a Golang program to find the greatest common divisor GCD using recursion. The greatest common divisor (GCD) of two or more numbers is the greatest common factor number that divides them, exactly. It is also called the highest common factor (HCF). For example, the greatest common factor of 15 and 10 is 5, since both the numbers can be divided by 5. 15/5 = 3 10/5 = 2 Algorithm Step 1 − Import the package fmt Step 2 − Start function main() Step 3 − We will use an ... Read More
In this tutorial, we shall learn to set the widths of the image border with JavaScript. To set the widths of the image border, use the borderImageWidth property in JavaScript. When we need an image as a border of our webpage content, we have to see how to set the width of the image border. Let us discuss the option to achieve this in brief. Using the Style borderImageWidth Property With the Style borderImageWidth property, we can set or return the widths of the image border of an element. The border image will range beyond the padding when the border ... Read More
In this tutorial, we shall learn to set when the transition effect starts with JavaScript. To set when the transition effect will start, use the JavaScript transitionDelay property. To make interactive components, we go for transition effects. Here let us get deeper into the topic and understand how we can set the transition start. Using the Style transitionDelay Property With Style transitionDelay property, we can set or return when the transition effect starts. We can specify the transitionDelay value in seconds(s) or milliseconds(ms). The delay can be either negative, positive, or zero. The transition effect starts immediately with a negative ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP