In this tutorial, we are going to see the Golang program to find the Area of a Circle. The area is the total space covered by any closed figure. Formula Area of Circle - 22 / 7 * r * r r - radius of a Circle For example, the radius of a Circle is 10 cm so the Area of a Circle is − Area = 22 / 7 * 10 * 10 = 4.2857142857143 Finding the Area of a circle within the function Algorithm STEP 1 − Declaring the variables for the ... Read More
In this tutorial, we are going to see the Golang program to find the perimeter of a rectangle. Perimeter is the total length of the boundary of any closed figure Formula Perimeter of rectangle - 2 * ( L + B ) L - Length of a rectangle B - Breadth of a rectangle For example, the length of a rectangle is 100 cm and the breadth is 50 cm so the Perimeter of a rectangle is − Perimeter = 2 * (100 + 50) cm = 2 * (150) cm = 300 ... Read More
In this tutorial, we are going to see the program for calculating compound interest in Golang. It is a method of finding the accurate interest on loans in the banking and finance sector using factors like principal amount, rate per annum, and time. Due to more accuracy, the rates are higher than the simple interest. Formula compound_Interest = P * ( 1 + R / 100) ^ T P = Principal amount R = Rate per annum T = Time For example, suppose the principal amount is 1000, the rate of interest is 4 and the interval is 2 ... Read More
In this tutorial, we are going to see the program for calculating simple interest in Golang. It is a method of finding the interest on loans in the banking and finance sector using some factors like principal amount, rate per annum, and time. Formula simple_Interest = ( p * r * t) / 100P = Principal amountR = Rate per annumT = Time For example, suppose the principal amount is 1000, the rate of interest is 4 and the interval is 2 years then the simple interest is. Simple_interest = (1000 * 4 * 2) / 100 ... Read More
In this tutorial, we are going to write and explain the code to find the factorial of a number in Golang. The factorial is the multiplication of the number with all the numbers less than it. In this tutorial, we will see two ways to find the factorial in Golang. One is by creating a recursive function. Second, by using the for a loop. For example, the factorial of 5 is: 5! = 5 * 4 * 3 * 2 * 1 = 120 A recursive approach to finding the factorial of a number Algorithm STEP 1 − ... Read More
In this tutorial, we are going to write and explain the code to check whether the given number is a neon number or not. The Neon number is a number that is equal to the sum of all the digits of its square. For example, 9 is a neon number as shown below The square of 9 is: 9 * 9 = 81 The sum of each digit of the square i.e 81 is 9 and the number is also 9 so 9 is a Neon number. Algorithm STEP 1 − First we are declaring the numbers between ... Read More
In this tutorial, we are going to write and explain the code for finding the Armstrong number between two integers. The Armstrong number is a number whose sum of the cube of all the digits in the number is equal to the number itself. For example, 153 is a number as shown below 153 = 1^3 + 5^3 + 3^3 = 1 + 125 + 27 = 153 Algorithm STEP 1 − First we are declaring the numbers between which we have to find the Armstrong Numbers. STEP 2 − Now, we ... Read More
Comments are used to explain the code flow and want to prevent the code from executing. In JavaScript, there are two types of comments. One is single-line comments, used to comment on the single-line code to prevent the code from executing or to explain the code. Another one is multi-line comments, used to comment on blocks of code to prevent the code from the execution or to explain code that is added in or code. By adding comments, we will give clarity to other developers also why code is added and what that particular code will do. Commented code will ... Read More
No, it is not recommended to use HTML comments to comment blocks of code. When JavaScript has first released some browsers didn’t have any support to understand the script. So a technique was then needed to hide the script code for older browsers. So that time the HTML comment within the JavaScript block was used to prevent the older browsers from showing the script code as text on the page. This technique was followed in the 1990s. Such browsers do not exist now, which wanted you to use HTML comments in JavaScript. Now all browsers understand the JavaScript blocks, so ... Read More
In this tutorial, we will learn how to remove the last array element in JavaScript and return it. In JavaScript, arrays are described as list-like objects. A single array object can store multiple values. An array object is stored in a variable. Array elements are stored in a memory location. Each array element is identified by its index value. You must process an array by inserting an element, removing or changing, etc. JavaScript has a lot of methods to update an array. Let us look at various ways to remove the last array element in JavaScript. Following are the Methods/Functions ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP