Akhil Sharma has Published 671 Articles

Golang Program to print a hollow star triangle pattern

Akhil Sharma

Akhil Sharma

Updated on 10-Feb-2023 17:00:25

207 Views

In this tutorial, we will learn how to print hollow star triangle pattern using Go programming language. The user can specify the maximum number of rows to print as an inverted pyramid star pattern using this GO programmed. Here, we'll print the inverted Pyramid of * symbols up till the ... Read More

Golang Program to Create an enum class

Akhil Sharma

Akhil Sharma

Updated on 10-Feb-2023 16:58:57

370 Views

An enum combines related constants into a single type. Enums are a strong feature with many applications. However, compared to the majority of other programming languages, they are implemented very differently in Go. In this article, we'll see how to use a predeclared identifiable iota to implement enums in Golang. ... Read More

Golang Program to Find the Largest Element in an Array

Akhil Sharma

Akhil Sharma

Updated on 10-Feb-2023 16:57:03

2K+ Views

In this tutorial, we will see to write a go language program to search the largest element in an array. an array is a variable that is used to store elements at contiguous memory locations. We can find the largest element of an array by either using a separate function ... Read More

Golang Program to Rotate Elements of an Array

Akhil Sharma

Akhil Sharma

Updated on 10-Feb-2023 16:54:56

402 Views

In this tutorial, we will see to write a go language program to rotate an array. We will write two programs for this. One to rotate the array to left and another to rotate it to right. Algorithm STEP 1 − Import the fmt package that allows us to print ... Read More

Golang Program to get the flattened 1D array

Akhil Sharma

Akhil Sharma

Updated on 10-Feb-2023 16:53:11

917 Views

In this tutorial, we will write a go language program to get the flattened 1D array from a multidimensional 2D array. A multi-dimensional array is an array of arrays, where each inner array represents a row of elements. A 1D array, on the other hand, is a single array that ... Read More

Golang Program To Find the Trace and Normal of a given Matrix

Akhil Sharma

Akhil Sharma

Updated on 10-Feb-2023 16:51:59

115 Views

In this tutorial we will write an article to find the normal and trace of a matrix. A matrix is considered to be normal if its square root equals the sum of the squares of each member and trace is the total of a matrix's diagonal elements. Finding Normal of ... Read More

Golang Program to get the subarray from an array using a specified range of indices

Akhil Sharma

Akhil Sharma

Updated on 10-Feb-2023 16:49:34

928 Views

In this tutorial, we will write a go language program to get the sub array from an array using a specified range of indices. A subarray is a contiguous portion of an array, specified by a range of indices. For example, given the array [1, 2, 3, 4, 5] and ... Read More

Golang Program to add an element in the array at the beginning

Akhil Sharma

Akhil Sharma

Updated on 10-Feb-2023 16:47:35

4K+ Views

In this tutorial, we will write a go language program to add an element in the array at the beginning of an array. to add an element in the starting of an array we will use for loops and the concept of indexing in arrays. We shall now discuss these ... Read More

Golang Program to get array elements after N elements

Akhil Sharma

Akhil Sharma

Updated on 10-Feb-2023 16:42:39

827 Views

In this tutorial, we will write a go language program to get the last given number of items from an array. We can do this by either using the inbuilt functions in go or using for loops. The first method is more efficient in functionality than the second one but ... Read More

Golang Program to find the Distinct elements from two arrays

Akhil Sharma

Akhil Sharma

Updated on 09-Feb-2023 15:52:48

845 Views

In this tutorial, we will see to write a go language program to find distinct elements in two arrays. In this article we will write two programs. In the first program we will use the array of strings while in the second one we will use the array of integers. ... Read More

Advertisements