This tutorial will discuss how to find the area of a rectangle in Golang programming using two methods − Area of the rectangle using length and breadth Area of the rectangle using diagonal and breadth Rectangle A rectangle is a two-dimensional shape that has four sides. The opposite sides of a rectangle are equal and all the angles of a rectangle are at 90°. Another property of a rectangle is that its opposite sides are parallel to each other. Area of a rectangle The total space enclosed within the boundary of the rectangle is known as the area ... Read More
In this tutorial, we will be discussing the approach to finding the volume of a cube in Golang programming using the sides of the cube. But before writing the code for this, let’s briefly discuss the cube and its volume. Cube A cube is a three-dimensional figure that has six square faces. All six faces of the cube are in the shape of a square. Its length, breadth, and height are equal. Dice is a common example of a cube. Volume of a cube The total three-dimensional space occupied by the cube is known as the volume of ... Read More
In this tutorial, we will be discussing the approach to calculate the volume and area of a cylinder in Golang programming using its height and radius. But before writing the code for this, let’s briefly discuss the cylinder and its volume and area. Cylinder A cylinder is a three-dimensional figure whose base has a circular shape. The distance between the two bases is known as the cylinder’s height ‘h’ and the radius of the base is denoted by ‘r’. A cold drink can is a good example of a cylinder. Volume of a cylinder The capacity ... Read More
In this tutorial, we will be discussing the approach to calculate the volume and area of a sphere using its radius in Golang programming. But before writing the code for this, let’s briefly discuss the sphere and its volume and area. Sphere A sphere is a three-dimensional figure whose all points are equidistant from the center. It has no edges and no faces. The radius of the sphere is denoted by ‘r’. A ball is a good example of a sphere. Volume of a sphere The capacity or amount of space a sphere occupies is termed ... Read More
In this tutorial, we will be discussing the approach to calculate the volume and area of a cone using its height and radius in Golang programming. But before writing the code for this, let’s briefly discuss the cone and its volume and area. Cone A cone is a three-dimensional figure that is pointed at the top and its base is flat and curved. The height of the cone is denoted by ‘h’ and the radius of the flat curved surface is denoted by ‘r’. An ice cream cone is a good example of a cone. $$\mathrm{where\: length \, ... Read More
In this tutorial, we will be discussing the program to find the sum of all odd numbers up to ‘N’ in Golang programming. But before writing the code for this, let’s have a brief discussion on odd numbers. Odd Numbers An odd number is a number that is not completely divisible by 2 and its remainder is always 1 when the number is divided by 2. A simple way to check whether a number is an odd number or not is to check its last digit. If the last digit is 1, 3, 5, 7, or 9, then the number ... Read More
In this tutorial, we will be discussing the program to find the sum of all even numbers in Golang programming. But before writing the code for this, let’s briefly discuss even numbers. Even Numbers An even number is a number that is completely divisible by 2 and its remainder is always 0. A simple way to check whether a number is an even number or not is to check its last digit. If the last digit is 0, 2, 4, 6, or 8, then the number is said to be an even number. Iterate through the first n even numbers ... Read More
In this tutorial, we will be discussing the approach to finding the surface area of a cube in Golang programming using the sides of the cube. But before writing the code for this, let’s briefly discuss the cube and its area. Cube A cube is a three-dimensional figure that has six square faces. All six faces of the cube are in the shape of a square. Its length, breadth, and height are equal. Dice is a common example of a cube. Area of a cube The total area enclosed by all six faces of the cube is known as the ... Read More
Have you ever wondered how different layers of the network work together to send messages? Before going into details, let us first understand some basic terms.Address Resolution Protocol (ARP) request is a protocol that converts IP addresses to MAC addresses.A routing table is a set of rules, usually displayed in tabular format, used to determine the routing location of data packets transmitted over an Internet Protocol (IP) network.In a typical network, the host device or main computer has all the layers and on the other hand, the router has a network, data link layer and a physical layer.ExampleAssuming that we ... Read More
In this article we are going to learn how to understand JavaScript module pattern. The Module pattern is used to copy the concept of classes, so that we can store both public and private methods and variables inside a single object. Since JavaScript doesn’t support classes, similar to classes that are used in other programming languages like Java or Python. Why use modules? Maintainability − A module is self-contained and aims to lessen the dependencies, so that it can grow and improve independently. Name spacing − In JavaScript, variables outside the scope of a top-level function are global. Because ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP